Enabling and deleting caches in Codeigniter is fairly straightforward and easy. In this post, I am writing about deleting caches. You no longer need to delete caches manually in Codeigniter 2.x version.
If you no longer wish to cache a file in Codeigniter you can remove the cache files. Following are two methods to do it.Clearing all cache
You can clear the entire cache directory by calling $this->output->clear_all_cache();
Note: This will not remove the .htaccess and index.html files in the applications/cache folder.
//Clears all cache from the cache directory $this->output->clear_all_cache();This method returns NULL.
Clearing a cached path
You can clear any specified path of its cache by calling following method.
//Clears the cache for the specified path $this->output->clear_path_cache($uri);This method will return boolean TRUE if successful, FALSE if not.
You can find all the information/source-code about clearing cache inside "application/core/MY_Output.php"