私はCodeIgniterを使用しています。常に私のページの一部はキャッシュであり、ブラウザではCtrl+F5
で削除されません。私はそれが働いたビューで名前ページを変更します。 !!!CodeIgniterでページキャッシュがクリアされる方法
CodeIgniterでページキャッシュをクリアするにはどうすればよいですか?
私はCodeIgniterを使用しています。常に私のページの一部はキャッシュであり、ブラウザではCtrl+F5
で削除されません。私はそれが働いたビューで名前ページを変更します。 !!!CodeIgniterでページキャッシュがクリアされる方法
CodeIgniterでページキャッシュをクリアするにはどうすればよいですか?
おそらくsession
にあります。クッキーを削除してください。
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);
}
私はChromeブラウザでCookieを削除するが、OKではありません。 –
私はそれが働いたビューで名前ページを変更します。 !!! –
ここに記載されているように、保存されたサーバー側:http://codeigniter.com/user_guide/general/caching.html – nonchip