![]() |
Expired cache files are not cleared - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Expired cache files are not cleared (/showthread.php?tid=79105) |
Expired cache files are not cleared - AngelRodriguez - 04-20-2021 Hi, I have a problem, expired cache files are not cleared. Saving cache like (this for example) version CI 4.1.1 PHP Code: if (! $foo = cache('foo')) Files are supposed to delete themselves, right? Or do I have to do something manually to delete them? Thank you Ángel RE: Expired cache files are not cleared - InsiteFX - 04-20-2021 If they do not delete you can do it yourself like so. PHP Code: $cache = \Config\Services::cache(); RE: Expired cache files are not cleared - lucascortes - 12-09-2023 Get the entire cache and loop one by one, so if it is expired it will return NULL and delete the file. Code: $allDataCache = $this->cache->getCacheInfo(); |