3 set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../../min/lib'));
4 require 'HTTP/ConditionalGet.php';
6 // emulate regularly updating document
8 $lastModified = round(time()/$every)*$every - $every;
10 $cg = new HTTP_ConditionalGet(array(
11 'lastModifiedTime' => $lastModified
14 if ($cg->cacheIsValid) {
19 $title = 'Last-Modified is known : simple usage';
21 <p>If your content has not changed since a certain timestamp, set this via the
22 the <code>lastModifiedTime</code> array key when instantiating HTTP_ConditionalGet.
23 You can immediately call the method <code>sendHeaders()</code> to set the
24 Last-Modified, ETag, and Cache-Control headers. The, if <code>cacheIsValid</code>
25 property is false, you echo the content.</p>
26 <p>This script emulates a document that changes every ' .$every. ' seconds.
27 <br>This is version: ' . date('r', $lastModified) . '</p>
30 require '_include.php';
32 echo send_slowly(get_content(array(
34 ,'explain' => $explain