如何在CodeIgniter中清除页面缓存

Jen*_*ony 6 php caching codeigniter

我使用CodeIgniter.总是我的页面的一部分是缓存,不要Ctrl+F5在浏览器中删除.当我在视图中更改名称页面时它工作.!?

如何清除CodeIgniter中的页面缓存?

bir*_*ric 10

您需要手动删除application/cache文件夹中的缓存项目.

https://www.codeigniter.com/user_guide/general/caching.html


小智 5

function delete_cache($uri_string=null)
{
    $CI =& get_instance();
    $path = $CI->config->item('cache_path');
    $path = rtrim($path, DIRECTORY_SEPARATOR);

    $cache_path = ($path == '') ? APPPATH.'cache/' : $path;

    $uri =  $CI->config->item('base_url').
            $CI->config->item('index_page').
            $uri_string;

    $cache_path .= md5($uri);

    return unlink($cache_path);
}
Run Code Online (Sandbox Code Playgroud)


Nea*_*eal -6

它可能位于session.尝试删除您的 cookie。