我使用CodeIgniter。总是我的网页的一部分是缓存,不删除的Ctrl+F5在浏览器中。当我改变名称页在视图中工作!!!?如何在CodeIgniter中清除页面缓存?
Ctrl+F5
u0sqgete1#
您需要手动删除application/cache文件夹中的缓存项目。https://www.codeigniter.com/user_guide/general/caching.html
application/cache
6kkfgxo02#
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); }
sy5wg1nm3#
public function clear_path_cache($uri) { $CI =& get_instance(); $path = $CI->config->item('cache_path'); //path of cache directory $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); }
xiozqbni4#
它可能在session中。请尝试删除您的Cookie。
session
4条答案
按热度按时间u0sqgete1#
您需要手动删除
application/cache
文件夹中的缓存项目。https://www.codeigniter.com/user_guide/general/caching.html
6kkfgxo02#
sy5wg1nm3#
xiozqbni4#
它可能在
session
中。请尝试删除您的Cookie。