After a couple of years with no cache problems in Codeigniter, I discovered one. I have see the problem described other places, but with no solution that works for me.
If I for example change some plain html text in a view and upload a new file and press F5 the old cached file is shown. If I afterwards press ctrlF5 the new is shown, and F5 again gives me back the old cached file. I have tried to flush the browser cache manually, but we no effect. After a couple of minutes the old cached file gets replaced with the new one. This issue gives me problems with login and logout.
I have without luck placed the following code in both the login and logout controller;
$this->output->cache(0);
$this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
$this->output->set_header('Cache-Control: no-store, no-cache, max-age=0, must-revalidate, post-check=0, pre-check=0');
$this->output->set_header('Pragma: no-cache');
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
I have not activated output cache in any controller ($this->output->cache(n)) or have a cache folder (application/cache or system/cache/(beore 2.0.0)) or use db cache (['cache_on'] = FALSE) in the config file.
I am using: Codeigniter 2.0.0 Firefox 21.0
I think that the cache files are stored somewhere on the Linux server, but where and how to flush, I don't know.
Any help or pointing in the right direction will be fine. Thx!
Best regards Martin
Cache files are not deleted before they expire. Cache files are saved in application/cache folder. you can manually delete it from there.
Additionally, you can better manage your cache(programatically), by either adding cache helper or extending your output class with clear page cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With