Disable browser cache easily with codeigniter

Disable browser cache easily with codeigniter

In this tutorial, we are going to how to disable browser cache easily with Codeigniter. normally, When the user logout that time destroy the session but when we click to ‘Go Back’ button on own browser we can see the cached dashboard page. in that time we have faced that type of issue.

How to disable browser cache easily in Codeigniter, How to avoid browser cache, Disable cache in Codeigniter, Codeigniter cache

Config setting

We will configure prefix in config.php file on “application/config” directory. if you want to keep custom prefix different name then you can. This item allows you to set the filename/classname prefix when extending.

So, we will create MY_Output.php file on “application/core” directory. after then paste the below code in this file.

Now, we will paste below code in the constructor function for first-time call the controller. because when call that method then it’s every time disable browser cache.

Please follow and like us: