2011-09-14 27 views

Trả lời

-6

Có thể là trong một session. Thử xóa cookie của bạn.

+0

tôi xóa các cookie trong trình duyệt chrome nhưng không ok. –

+0

khi tôi thay đổi trang tên trong chế độ xem nó hoạt động. !!!? –

+0

bên máy chủ đã lưu của nó, như được mô tả ở đó: http://codeigniter.com/user_guide/general/caching.html – nonchip

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); 
} 
3
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); 
} 
Các vấn đề liên quan