Codeigniter Cache Files Not Deleted

I am trying to use web page caching using CodeIgniter. His Docs talk about generated cache files:

If it has expired, it will be deleted and updated before being sent to the browser.

But I noticed that the files with the expired cache were not deleted, and my cache folder continues to grow.

How can I fix this situation (possibly without a cron job that deletes cached files)?

Source: http://codeigniter.com/user_guide/general/caching.html

+4
source share
2 answers

The cron task you proposed is the most efficient. Do you really want to slow down the user by forcing them glob () through your cache?

You can run a hook that determines if the user agent is a robot, and delete old files in this case, but be careful which bot you run for it, or you might get some results from “this page slowly” random sites. :)

+1
source

I set 60 * 24 minutes (one day). Perhaps I set the wrong permissions in the directory and could not delete the files ... Now everything is in order

+1
source

Source: https://habr.com/ru/post/1446622/


All Articles