Hy there. I need to implement cache for my PHP web application. I implemented the cache file control (saving and getting files from cache dir) but now I need to enforce cache folder max size control, because cache folder should be limited in max size.
I had an idea to limit the size by deleting the least used files when the space is needed. Now, I've read that using the fileatime function on all the files in cache dir would slow down my application.
Is there any other method that springs in your mind?
(DB (MySQL) usage for storing last access time for cache files is, unfortunately, unimplementable.)