Adding support for etags in $.ajax() - and simplified the if-modified-since implement...
[jquery.git] / test / data / etag.php
1 <?php
2 error_reporting(0);
3
4 $ts = $_REQUEST['ts'];
5 $etag = md5($ts);
6
7 $ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false;
8 if ($ifNoneMatch == $etag) {
9     header('HTTP/1.0 304 Not Modified');
10     die; // stop processing
11 }
12
13 header("Etag: " . $etag);
14 echo "OK: " . $etag;
15
16 ?>