Some effort to use with PHP:
<?php
$timestamp = /* timestamp for last updated part */;
$tsstring = gmdate("D, d M Y H:i:s ", $timestamp)."GMT";
if ($_SERVER["HTTP_IF_MODIFIED_SINCE"] == $tsstring) {
/* The UA has the exact same page we have. */
header("HTTP/1.1 304 Not Modified");
exit();
} else {
header("Last-Modified: ".$tsstring);
}
?>
Set Cache-Control headers so external caches know how to respect your content:
<?php
header("Last-Modified: Mon, 13 Se4 2002 09:44:13 GMT");
header("Expires: Mon, 13 Sep 2004 10:44:13 GMT");
header("Cache-Control: must-revalidate, max-age=15, s-maxage=0, private");
?>