Skip to content

Instantly share code, notes, and snippets.

@og-shawn-crigger
Created April 5, 2012 07:38
Show Gist options
  • Save og-shawn-crigger/2308795 to your computer and use it in GitHub Desktop.
Save og-shawn-crigger/2308795 to your computer and use it in GitHub Desktop.
CodeIgniter Snippet to Force No Cache Headers
<?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");
}
@fahadrana31
Copy link

hi!

i am facing this problem with my cart in codeigniter. can you tell me how can i implement on my website?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment