<?php
function bustcache()
{
if(headers_sent())
{
trigger_error('Already sent HTTP headers, not busting the cache', E_NOTICE);
}
else
{
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
}
?>
The above is a very simple function for preventing a browser from caching content. This isn't recommended on static sites, but is exceptionally helpful when building dynamic applications. Simply call this function before any output.
I am ttolaly wowed and prepared to take the next step now.
Ladainian @ 10:42:17 AM, Sunday, October 23, 2011