CodeIgniter Forums
Identifying an individual file in the cache - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Identifying an individual file in the cache (/showthread.php?tid=8213)



Identifying an individual file in the cache - El Forum - 05-09-2008

[eluser]Unknown[/eluser]
Hello.

We have a website with around 43,000 database records with each individual record containing various fields we use to display information on a page. The site uses a CMS and we have enabled caching.

What we want to do is identify an individual cached page somehow so that we can delete that cached version when we make an update rather than dump the entire cache.

Can this be done within the framework? Has anyone come up with a solution to this?

Apologies in advance if I am being a pratt and have missed something blatantly obvious.


Identifying an individual file in the cache - El Forum - 05-09-2008

[eluser]GSV Sleeper Service[/eluser]
the cache filename is an md5 sum, see Output.php in the system/libraries folder to see how it works, but basically it's
Code:
$uri =    $CI->config->item('base_url').
    $CI->config->item('index_page').
    $CI->uri->uri_string();
$cache_path .= md5($uri);
so you should be able to determine what cache file to delete by rebuilding $uri and finding the md5sum


Identifying an individual file in the cache - El Forum - 05-25-2008

[eluser]Unknown[/eluser]
Genius. Thank you.