Removing Cache from the page
There are two methods of avoiding a page to be stored in browser cache. 1st method is better because each browser interprete Meta tag differently.
1. Using the PHP Header. Use the following code before rendering any output to the browser.
<?php
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('Expires: Mon,26 Jul 1980 05:00:00 GMT');
header("Last-Modified: Tue,01 Jan 2000 00:00:00 GMT");
?>
2. Using the HTML Meta tag.
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
1. Using the PHP Header. Use the following code before rendering any output to the browser.
<?php
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('Expires: Mon,26 Jul 1980 05:00:00 GMT');
header("Last-Modified: Tue,01 Jan 2000 00:00:00 GMT");
?>
2. Using the HTML Meta tag.
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />