中的清除頁面緩存如何。總是我的頁面的一部分緩存,並且不會通過browser.when中的Ctrl+F5
刪除。當我在其視圖中更改了名稱頁面時。 !?我使用CodeIgniter的CodeIgniter
如何清除CodeIgniter中的頁面緩存?
中的清除頁面緩存如何。總是我的頁面的一部分緩存,並且不會通過browser.when中的Ctrl+F5
刪除。當我在其視圖中更改了名稱頁面時。 !?我使用CodeIgniter的CodeIgniter
如何清除CodeIgniter中的頁面緩存?
它可能在session
。嘗試刪除您的cookies。
您需要手動刪除application/cache
文件夾中的緩存項目。
http://ellislab.com/codeigniter/user-guide/general/caching.html
https://www.codeigniter.com/user_guide/general/caching.html是當前的3.x鏈接.... –
你可以使用這個簡單的插件,以幫助清除單個頁面緩存。
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);
}
public function clear_path_cache($uri)
{
$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;
$cache_path .= md5($uri);
return @unlink($cache_path);
}
/**
* Clears all cache from the cache directory
*/
public function clear_all_cache()
{
$CI =& get_instance();
$path = $CI->config->item('cache_path');
$cache_path = ($path == '') ? APPPATH.'cache/' : $path;
$handle = opendir($cache_path);
while (($file = readdir($handle))!== FALSE)
{
//Leave the directory protection alone
if ($file != '.htaccess' && $file != 'index.html')
{
@unlink($cache_path.'/'.$file);
}
}
closedir($handle);
}
我刪除cookies在chrome瀏覽器,但不能確定。 –
當我改變它的視圖名稱頁面的工作。 !? –
其保存的服務器端,如下所述:http://codeigniter.com/user_guide/general/caching.html – nonchip