PHP code to disable caching of a page
Posted On at by milanWhile development some times our pages don't refresh automatically after we delete some record and come back. They actually show the page from cache and we need to manually refresh the page. Here is simple short PHP code to stop a page from being saved into the cache.
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 12 Jul 1996 04:11:00 GMT'); //Any date passed.
header('Pragma: no-cache');
?>