There. I need to implement a cache for my PHP web application. I implemented a cache control (saving and retrieving files from the dir cache), but now I need to ensure the maximum cache size, since the cache folder should be limited to the maximum size.
I had the idea to limit the size by deleting the least used files when this space is needed. Now I read that using the fileatime function in all files in the cache will slow down my application.
Is there any other method that arises in your mind?
(Using DB (MySQL) to store the last access time for cache files, unfortunately, is not implemented.)
source
share