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");

Commenting HTML, CSS, PHP, Javascript, SQL & ASP

Use the tags below to enter comments or notes in your HTML, CSS, PHP, JavaScript or ASP code:


Language Single/Multi-Line Start with End with Example

HTML

Single & Multi-Line

<!–

–>

<!– This is an HTML Comment –>

PHP

Single Line

//

// This is a PHP Comment

PHP

Mutli-Line

/*

*/

/* This is

a PHP Comment */

JavaScript

Single Line

//

// This a JScript Comment

JavaScript

Mutli-Line

/*

*/

/* This is

a JavaScript Comment */

CSS

Single & Multi-Line

/*

*/

/*This is a CSS comment*/

ASP

Single & Multi-Line

‘ This is an ASP Comment

SQL

Single & Multi-Line

{

}

{ This is an SQL Comment }

SQL

Single

— (Two dashes)

— This is an SQL Comment