You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have larger collections and load this collection multiple times during a request Sheets::collection('large')->all() the memory can quickly explode.
A solution would be to use the already present unique string key for a single sheet in a poor man cache to keep the same sheet object reference for the whole request/runtime.
if (! isset($cache[$collectionName][$sheetName])) {
$cache[$collectionName][$sheetName] = newSheet(...);
}
return$cache[$collectionName][$sheetName];
This should be a non breaking change as long as the sheet file isn't changed on runtime. In this case it should be possible to invalidate a cache entry.
The cache logic should be placed in the repository which loads the file content - in this case #45 would provide a solution outside the package. But I would like to provide this as a trait in the package. This way it would be reusable for all custom repositories with a single method call.
The text was updated successfully, but these errors were encountered:
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
If I have larger collections and load this collection multiple times during a request
Sheets::collection('large')->all()
the memory can quickly explode.A solution would be to use the already present unique string key for a single sheet in a poor man cache to keep the same sheet object reference for the whole request/runtime.
This should be a non breaking change as long as the sheet file isn't changed on runtime. In this case it should be possible to invalidate a cache entry.
The cache logic should be placed in the repository which loads the file content - in this case #45 would provide a solution outside the package. But I would like to provide this as a trait in the package. This way it would be reusable for all custom repositories with a single method call.
The text was updated successfully, but these errors were encountered: