Clear Browser Cache Using HTML or PHP

To clear the browser cached page or to force the browser to re-download the content of a page, you can place the following HTML code in the header tags (<head>) of the page. This code will ask the broswer to ignore any saved copies of the page, and to re-download page content.

HTML Code:


If you prefer working with PHP, you can do the exact same using this PHP code:

PHP Code:

header ("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");  
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  
header ("Cache-Control: no-cache, must-revalidate");  
header ("Pragma: no-cache");