Introduction:

Caching is the technique of keeping frequently used data in memory for rapid access when required. By decreasing the time it takes to access data from the database, caching aids in improving the performance of online applications. By lowering the volume of requests that must be handled, caching also aids in minimizing the server's workload.

Your page load times are impacted by the amount of dynamic information you display on your sites based on server resources, memory, and processing cycles used. You can achieve performance close to that of static web pages by caching your pages.

How to clear cache in Codeigniter framework ?

Removing the caching tag will stop the file from being reloaded after it expires if you no longer want to cache it. Removing the tag will not automatically remove the cache, take note. Normally, it will expire after a while. If you want to get rid of it, you'll have to manually delete it out of the "application/cache" folder on your computer. There are also two more ways to get rid of the cache. The 2 methods are :

1. Clearing all cache : 

To delete all caches, use the $this->output->clear_all_cache() function;

Note that the index.html and.htaccess files located in the applications/cache folder will not be deleted.

$this->output->clear_all_cache(); // Clears all cache from the cache directory

2. Clearing a cached path

By executing the following method, you can clear the cache for any specified path. This method will return boolean TRUE if successful, FALSE if not.

$this->output->clear_path_cache($uri); //Clears the cache for the specified path