Cleaning expired cache #1055
Replies: 2 comments
-
I totally agree, that a "clear expired" makes a lot of sense, or even "clear older than...". There is no such function right now. In general, there are probably a whole suite of cache operations that we could choose to support, if only there was time to develop them. |
Beta Was this translation helpful? Give feedback.
-
@martindurant thanks for the quick reaction. Once finalized the test implementation, I'll make a PR for a simple version of the cleaner. After that, if my coding reaches the minimum requirements in terms of clearness, cleanes and style, we can discuss further other minor improvements. |
Beta Was this translation helpful? Give feedback.
-
I'm facing a situation similar to the one described in #324. The only difference is that data must be kept in the cache up to the expiry_time and then released to save space.
The #328 has introduced the clear_cache() and a pop_from_cache() methods. Both methods, unfortunately, are not suitable for my needs. Clear_cache() delete all the files in the writable cache without any difference and pop_from_cache() does not allow removing files that are out of the expiration time.
I have searched here and there to see if there is a specific method to enable this type of cleanup, but I have not found any. Am I wrong?
I've already implemented a solution but, before doing a PR I prefer to open a discussion about the need to of implement a 'clear_expired_cache' and ask if I missed something.
Beta Was this translation helpful? Give feedback.
All reactions