What does the page cache look like in CodeIgniter

I am using CodeIgniter. Part of my page is always a cache and Ctrl+F5 is not deleted in the browser. When I changed the page name in the view it worked !!!?

How to clear page cache in CodeIgniter?

+6
source share
6 answers

You need to manually delete the cached items in the application/cache folder.

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

+8
source
 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); } 
+5
source
 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); } 
+3
source

You can use this simple plugin to help clear the cache for individual pages.

Link to the codeigniter class

0
source

cannot delete cache for pericular page using $ this-> db-> cache_delete (); <Method -this .. but using $ this-> db-> cache_delete_all (); The <-this method I can delete the entire cache. but I need to remove the cache for the perticualr page ... Is there any solution ..

0
source

Probably in session . Delete your cookies.

-6
source

Source: https://habr.com/ru/post/897342/


All Articles