Closed mlavrinenko closed 1 year ago
Hello curious contributor ! Since it seems to be your first contribution, make sure that you've been:
Hello,
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.
Cheers, Georges
Hello @mlavrinenko,
I’m closing this issue for now because of (inactivity / outdated code / …).
You can always reopen it though! :) Please (update the issue / add comment / clarify …).
Regards, Georges.L
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)
https://github.com/PHPSocialNetwork/phpfastcache/blob/8614c5624e56b6f41fa666fdec3dc746b52df6b4/lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php#L142
Do you have anything more you want to share? (optional)
No response