CodeIgniter Forums
Cache control - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Cache control (/showthread.php?tid=37094)



Cache control - El Forum - 12-27-2010

[eluser]Unknown[/eluser]
Hi all,

Codeigniter gives us a very simple but efficient page caching system.
However, I wanted to clear a specific cached page (for example, when that page has been updated by contributor or admin via the backoffice).
No problem, here is a quick and dirty workaround:

Code:
...
$uri =    '/'.$this->config->item('base_url').$this->config->item('index_page').$pageurl;
$cache_path .= md5($uri);
if (is_file($cache_path))
{
    unlink($cache_path);
}
...

...which work nice and smooth.

But is there a way to use native CI method/class, to do it in a clean way ?

Thank you !