Tuesday, April 27, 2010

To delete the Cache of previous page

This code can be used in the php pages where the cache will be deleted and this will be usefull for logout functionality where after logout it should not go to the previous page

// Date in the past
header(”Expires: Mon, 26 Jul 1997 05:00:00 GMT”);
// always modified
header(”Last-Modified: ” . gmdate(”D, d M Y H:i:s”) . ” GMT”);
// HTTP/1.1
header(”Cache-Control: no-store, no-cache, must-revalidate”);
header(”Cache-Control: post-check=0, pre-check=0″, false);
// HTTP/1.0
header(”Pragma: no-cache”);

No comments:

Post a Comment

 

Followers