Adding support for etags in $.ajax() - and simplified the if-modified-since implement...
[jquery.git] / test / data / if_modified_since.php
diff --git a/test/data/if_modified_since.php b/test/data/if_modified_since.php
new file mode 100644 (file)
index 0000000..013f446
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+error_reporting(0);
+
+$ts = $_REQUEST['ts'];
+
+$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false;
+if ($ifModifiedSince == $ts) {
+    header('HTTP/1.0 304 Not Modified');
+    die; // stop processing
+}
+
+header("Last-Modified: " . $ts);
+echo "OK: " . $ts;
+
+?>