How to prevent Browser cache for php site
try this
<?phpheader("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");header("Cache-Control: post-check=0, pre-check=0", false);header("Pragma: no-cache");?>
Here, if you want to control it through HTML: do like below Option 1:
<meta http-equiv="expires" content="Sun, 01 Jan 2014 00:00:00 GMT"/><meta http-equiv="pragma" content="no-cache" />
And if you want to control it through PHP: do it like below Option 2:
header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');header('Cache-Control: no-store, no-cache, must-revalidate');header('Cache-Control: post-check=0, pre-check=0', FALSE);header('Pragma: no-cache');
AND Option 2 IS ALWAYS BETTER in order to avoid proxy based caching issue.
You can try this:
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Connection: close");
Hopefully it will help prevent Cache, if any!