Skip to main content

Bug Tracker

Side navigation

Ticket #4764: etag.php
File etag.php, 0.3 KB (added by lawrencepit, June 15, 2009 07:26AM UTC)
<?php
error_reporting(0);

$ts = $_REQUEST['ts'];
$etag = md5($ts);

$ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false;
if ($ifNoneMatch == $etag) {
    header('HTTP/1.0 304 Not Modified');
    die; // stop processing
}

header("Etag: " . $etag);
echo "OK: " . $etag;

?>

Download in other formats:

Original Format