Welcome Guest, Not a member yet? Register   Sign In
Yet another cache question
#2

[eluser]SpooF[/eluser]
Heres the code I'm using:

This is the referring URI:
Code:
$this->session->set_flashdata('last_uri', $this->uri->uri_string());
This should go at the end of your function, as this is truly the URI of the current page request.

Code:
$path = $this->config->item('cache_path');
$cache_path = ($path == '') ? BASEPATH.'cache/' : $path;
$uri =    $this->config->item('base_url').
          $this->config->item('index_page').
          $this->session->flashdata('last_uri');
                
$file = $cache_path.md5($uri);

if(file_exists($file))
{
    unlink($file)
}
The above code will delete the cached file for the previous page.

I'm using this setup for when someone posts a comment to one of my posts.


Messages In This Thread
Yet another cache question - by El Forum - 06-11-2009, 02:20 AM
Yet another cache question - by El Forum - 06-11-2009, 03:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB