Forum Moderators: coopster
<?php
header('Cache-Control: max-age=10'); // Quick testing.
$lastmod = getlastmod();
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $lastmod)
{
header('HTTP/1.1 304 Not Modified');
die();
}
else
{
$gmtDate = gmdate('D, d M Y H:i:s\G\M\T',$lastmod);
header('Last-Modified: '.$gmtDate);
echo 'Last-Modified: '.$gmtDate;
}
?>
<?php
session_cache_limiter('private_no_expire');
date_default_timezone_set('GMT');
header('Cache-Control: max-age=10');
$lastmod = getlastmod();
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $lastmod)
{
header('HTTP/1.1 304 Not Modified');
die();
}
else
{
$expires = $lastmod + 12;
header('Expires: '.gmdate('D, d M Y H:i:s',$expires).' GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s',$lastmod).' GMT');
echo 'Last-Modified: '.gmdate('D, d M Y H:i:s',$lastmod);
}
?>
<?php
header('Cache-Control: max-age=10');
$lastmod = getlastmod();
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $lastmod)
{
header('HTTP/1.1 304 Not Modified');
die();
}
else
{
header('Last-Modified: '.gmdate('D, d M Y H:i:s',$lastmod).' GMT');
echo 'Last-Modified: '.gmdate('D, d M Y H:i:s',$lastmod);
}
?>