How to disable cache form browser using php
Using header function of the php we can disable the browser cache.
Browser cache
header (‘Expires: Mon, 14 Oct 2002 05:00:00 GMT’);
setting the date in past so that browser detect that page has generated in past..
<?
/**
* Disable any caching by the browserfunction disable_browser_cache()
{
@ header ('Expires: Mon, 14 Oct 2002 05:00:00 GMT'); // Date in the past
@ header ('Last-Modified: ' . gmdate ("D, d M Y H:i:s") . ' GMT'); // Always modified
@ header ('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP 1.1
@ header ('Cache-Control: post-check=0, pre-check=0', false);
@ header ('Pragma: no-cache'); // HTTP 1.0
}
//how to call this function
// Disable any caching by the browser
disable_browser_cache();
?>
so u are seing the above function to disable the cache from the browser using php.
so u can see using header function of php we can disable browser cache…
mrphpguru






