Handling If-modified-since header in a PHP-script
This is definitely possible in PHP! When the browser checks if there were modifications, it sends an If-Modified-Since header; in PHP this value would be set inside $_SERVER[‘HTTP_IF_MODIFIED_SINCE’]. To decode the date/time value (encoded using rfc822 I believe), you can just use strtotime(), so: if (isset($_SERVER[‘HTTP_IF_MODIFIED_SINCE’]) && strtotime($_SERVER[‘HTTP_IF_MODIFIED_SINCE’]) >= filemtime($localFileName)) { header(‘HTTP/1.0 304 Not Modified’); … Read more