Codeigniter caching - suggestions to refresh after new post Codeigniter caching - suggestions to refresh after new post codeigniter codeigniter

Codeigniter caching - suggestions to refresh after new post


From the CodeIgniter documentation:

If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you will need to manually delete it from your cache folder.

For programatically delete the cache file you can use

CodeIgniter Cache Helper

Here this function will delete the cache file

function delete_cache($uri_string)    {        $CI =& get_instance();        $path = $CI->config->item('cache_path');        $cache_path = ($path == '') ? APPPATH.'cache/' : $path;        $uri =  $CI->config->item('base_url').            $CI->config->item('index_page').            $uri_string;        $cache_path .= md5($uri);        if (file_exists($cache_path))        {            return unlink($cache_path);        }        else        {            return TRUE;        }    }