aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/if_modified_since.php
blob: 098b7da85006c0a4c892ff015a9f05ccc5990094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?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);

if ( $ifModifiedSince ) {
	echo "OK: " . $ts;
} else {
	echo "FAIL";
}

?>