Page is a not externally linkable
jd01 - 8:35 pm on Oct 10, 2007 (gmt 0)
header("Expires: " . gmdate("D, d M Y H:i:s", time()+24*60*60) . " GMT"); if($_SERVER['HTTP_IF_MODIFIED_SINCE']===$date ¦¦ $_SERVER['HTTP_IF_NONE_MATCH']===$etag) { I use a simple md5 hash based on URL / filemtime() to create custom ETag headers and ensure if I update the file a new request is made. The order in the file should be reversed... Justin
I usually set a 'future expires' and check for both an HTTP_IF_MODIFIED_SINCE and HTTP_IF_NONE_MATCH.
header('HTTP/1.1 304 Not Modified'); exit();
}
The Expires is created and set only if there is no match to either header, and needs to be set before any other output.