-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed cache flush exporting files #3477
Removed cache flush exporting files #3477
Conversation
…he illuminate cache driver
Hey thanks for your PR. I don't think it's a good idea to disable the entire flushing as that could clog up the cache driver. Maybe good to see if we could do something with a key and only clear that queue? Would you be up to PR'ing that? |
Another, perhaps better, option could be to allow to specify a specific illuminate cache store. That way your could have a separate cache for just excel, that way flushing it wouldn't break anything. |
Yes, I agree that disabling the entire flush isn't ideal. Still I think it's better to force the developers to manage themselves the flushing rather than not being able to have multiple users exporting a file. |
I guess every export should hold a unique cache key then |
Yes, that should be the idea. The only concern is that the cache prefix is different based on the cache driver. Please let me know your thoughts. |
From the phpsreadsheet docs:
That means if we don't flush it at the end of the process, the cache will clog up; because it will add a cache key for every cell, which adds up on big sheets (which the caching feature is intended for) |
I was under the same impression. However i tried to delete this line locally: WriterFlush and all the keys having |
I indeed see a reference to it here: https://github.com/PHPOffice/PhpSpreadsheet/blob/master/src/PhpSpreadsheet/Collection/Cells.php#L485 |
Correct. That's why I couldn't understand what keys the library is trying to flush. Unless I'm missing something, it is just the keys related to the dispatched jobs. |
Can you update the PR to remove the flush completely? (So no config setting needed) |
PR updated just now. |
Thanks 👍 |
The
Writer
class, in thewrite
function, is flushing the cache at the end of its process.Using the
illuminate
cache driver, this will result in flushing the entire cache, losing:1️⃣ Why should it be added? What are the benefits of this change?
The benefit is to allow multiple exports at the same time, without losing any job/keys stored in the cache.
2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.
No
3️⃣ Does it include tests, if possible?
Yes
4️⃣ Any drawbacks? Possible breaking changes?
No
5️⃣ Mark the following tasks as done:
6️⃣ Thanks for contributing! 🙌