From 3b50b96d830aa3875656806f56a6b1f153352f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 30 Aug 2013 21:08:07 +0200 Subject: [PATCH] Add cache headers --HG-- extra : rebase_source : 3598ab0524d7dfee1f28581de3ec1f95ca65fe66 --- epubfs.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epubfs.php b/epubfs.php index 0829678..b8c8bb6 100644 --- a/epubfs.php +++ b/epubfs.php @@ -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; }