]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Minify/extlib/minify/min_unit_tests/HTTP_ConditionalGet/5.php
Added minify plugin
[quix0rs-gnu-social.git] / plugins / Minify / extlib / minify / min_unit_tests / HTTP_ConditionalGet / 5.php
1 <?php
2
3 set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../../min/lib'));
4 require 'HTTP/ConditionalGet.php';
5
6 // far expires
7 $cg = new HTTP_ConditionalGet(array(
8     'maxAge' => 20
9     ,'lastModifiedTime' => filemtime(__FILE__)
10 ));
11 $cg->sendHeaders();
12
13 // generate, send content
14 $title = 'Last-Modified + Expires';
15 $explain = '
16 <p>Here we set a static "lastModifiedTime" and "maxAge" to 20. The browser
17 will consider this document fresh for 20 seconds, then revalidate its cache. After
18 the 304 response, the cache will be good for another 20 seconds. Unless you force
19 a reload, there will only be 304 responses for this page after the initial download.
20 ';
21
22 require '_include.php';
23 echo get_content(array(
24     'title' => $title
25     ,'explain' => $explain
26 ));
27