How to disable browser cache easily for particular, individual and separate function and controller in Codeigniter

twitter logo ・1 min read

defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Cacheoff extends CI_Cacheoff {
* author: https://www.blazingcoders.com
function disable_cache() {
$this->set_header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
$this->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$this->set_header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0');
$this->set_header('Cache-Control: post-check=0, pre-check=0', FALSE);
$this->set_header('Pragma: no-cache');


For more details check the link


twitter logo DISCUSS
Classic DEV Post from May 7 '19

The newly announced future of .NET - unifying all the things

Microsoft announces .NET 5

vivek kumar profile image
Website Design and mobile application development company in coimbatore, India. We have more than years of experience in IT Services with more than 400 clients. Services we provide website design,