Created
April 5, 2012 07:38
-
-
Save og-shawn-crigger/2308795 to your computer and use it in GitHub Desktop.
CodeIgniter Snippet to Force No Cache Headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function set_nocache_headers() | |
{ | |
$this->output->set_header("HTTP/1.0 200 OK"); | |
$this->output->set_header("HTTP/1.1 200 OK"); | |
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); | |
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); | |
$this->output->set_header("Cache-Control: post-check=0, pre-check=0"); | |
$this->output->set_header("Pragma: no-cache"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi!
i am facing this problem with my cart in codeigniter. can you tell me how can i implement on my website?