view cache_check.inc @ 6:6c0162497d56

Improved error reporting, and support for multilevel params.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Fri, 20 May 2011 22:28:03 +0200
parents d2da64705bce
children 91ee5f49907e
line wrap: on
line source

<?php
if (DEBUG)
  var_dump($_SERVER);

$HTTP_IF_MODIFIED_SINCE=$_SERVER['HTTP_IF_MODIFIED_SINCE'];
$if_modified_since = preg_replace('/;.*$/', '', $HTTP_IF_MODIFIED_SINCE);

$SCRIPT_FILENAME=$_SERVER['SCRIPT_FILENAME'];
$mtime = filemtime($SCRIPT_FILENAME);
$gmdate_mod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';

if ($if_modified_since == $gmdate_mod) {
    header("HTTP/1.0 304 Not Modified");
    exit;
}
header("Last-Modified: $gmdate_mod");
?>