Expiry for cache file

I am wondering how cache systems like doctrine-cache or zend-cache, set an expiry for cache files if those files are not in /tmp folder. How is possible to set an expiry for a cache files?

I don’t think it’s possible at all. You simply run a script periodically which checks all your cache files (for example with filemtime()) and deletes those that are older than a certain time in the past.

It really depends on the framework you’re using, and which kind of cache you want to expire… for example in Symfony2 you can set a max age to the HTTP cache. But there’s no general answer I’m afraid – just read the corresponding docs! ;-)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.