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
TaggableCacheItemPoolTrait->deleteItemsByTags loads all tag items and then deletes them. It can lead to high memory usage.
I cache a lot of fragile data. Any change in one piece of data should delete all tagged cache entirely. I considered the clear method, but I have some exceptions when some chunks of data isn't fragile and should survive such a cleanup.
CacheDeleteItem event can still be dispatched, but with lazy loading object passed to it. That means if there is no event handlers then no data will be loaded from driver.
Sorry for late reply.
The choice of loading cache item tags into the memory was because not all backends (like Redis) do support cache tags operations.
That means you need to handle them on the phpfastcache-level for others backends.
I wisely made the choice years ago because it was easier to implements and completely transparent for the developer.
I advice you to split your "crucial data" to a new different cache instance of phpfastcache that will survive even if your clear the data of your other cache instance.
What's your question ?
Hello!
TaggableCacheItemPoolTrait->deleteItemsByTags loads all tag items and then deletes them. It can lead to high memory usage.
I cache a lot of fragile data. Any change in one piece of data should delete all tagged cache entirely. I considered the clear method, but I have some exceptions when some chunks of data isn't fragile and should survive such a cleanup.
CacheDeleteItem event can still be dispatched, but with lazy loading object passed to it. That means if there is no event handlers then no data will be loaded from driver.
Or I just miss something?
References (optional)
phpfastcache/lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php
Line 142 in 8614c56
Do you have anything more you want to share? (optional)
No response
The text was updated successfully, but these errors were encountered: