I have a rails application that uses disk cache to cache Russian dolls by default. I have no problem disabling caching, and my cache strategy works with my requirements, however I have to find the right way to delete obsolete entries from disk. As indicated, the disk cache continues to grow until it is cleared or the disk is full.
I know what I can do rake tmp:cache:clear, but it deletes the entire cache, not just obsolete items! I am looking for the best way to keep fresh records and delete only obsolete cache entries from disk. I already use the shell script to delete records that were not available on the last day, but this does not guarantee that I delete only obsolete records and keep all fresh records.
I know that I can switch to memcached or redis, but I prefer not to do this, because the cache drive does an excellent job without the overhead of resources and supports another server (the server in terms of the server process, not the actual hardware / virtual machine )
How to delete obsolete cache entries when using disk cache? Is there a better way to use atime / mtime files?
source
share