summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/versioned-manifest.php
blob: 84a7a91265fb6d16a57669bc0b895b698a5894b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require_once '../../resources/portabilityLayer.php';

$tmpFile = sys_get_temp_dir() . "/" . "appcache_manifest_counter";

function getCount($file)
{
    if (!file_exists($file)) {
        file_put_contents($file, "0");
        return "0";
    }
    return file_get_contents($file);
}

function stepCounter($file)
{
    if (file_exists($file)) {
        $value = getCount($file);
        file_put_contents($file, ++$value);
    }
}

header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/cache-manifest");

if ("step" == $_GET['command'])
    stepCounter($tmpFile);

print("CACHE MANIFEST\n");
print("# version " . getCount($tmpFile) . "\n");
print("counter.php\n");
print("uncacheable-resource.php\n"); // with Cache-control: no-store
print("NETWORK:\n");
print("versioned-manifest.php?command=\n");
?>