Add cache headers

--HG--
extra : rebase_source : 3598ab0524d7dfee1f28581de3ec1f95ca65fe66
This commit is contained in:
Sébastien Lucas 2013-08-30 21:08:07 +02:00
parent 74c5abce0b
commit 3b50b96d83

View file

@ -46,6 +46,10 @@ try {
$data = preg_replace_callback ("/(href=)[\"']([^:]*?)[\"']/", $callback, $data);
$data = preg_replace_callback ("/(\@import\s+)[\"'](.*?)[\"'];/", $callback, $data);
$expires = 60*60*24*14;
header("Pragma: public");
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
header ("Content-Type: " . $book->componentContentType($component));
echo $data;
}