diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-03-10 09:58:22 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-03-10 09:58:22 +0400 |
commit | c1703a107774db816b5a65717ee1d9de394cffa4 (patch) | |
tree | 1ab01131e8138f69b95ae8290df942868daad092 /core/ProxyHttp.php | |
parent | 91f757858a58ffbc6b52dfd04f7fe70d5ac11313 (diff) |
cache /js/ for 10 days rather than none. Refs #2406
From forum feedback: http://forum.piwik.org/read.php?2,112741
Diffstat (limited to 'core/ProxyHttp.php')
-rw-r--r-- | core/ProxyHttp.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/ProxyHttp.php b/core/ProxyHttp.php index 5e091853ba..a5aec5789c 100644 --- a/core/ProxyHttp.php +++ b/core/ProxyHttp.php @@ -51,10 +51,10 @@ class ProxyHttp * * @param string $file The location of the static file to serve * @param string $contentType The content type of the static file. - * @param bool $expireFarFuture If set to true, will set Expires: header in far future. - * Should be set to false for files that don't have a cache buster (eg. piwik.js) + * @param bool $expireFarFuture Day in the far future to set the Expires header to. + * Should be set to false for files that don't have a cache buster (eg. piwik.js) */ - public static function serverStaticFile($file, $contentType, $expireFarFuture = true) + public static function serverStaticFile($file, $contentType, $expireFarFutureDays = 100) { if (file_exists($file)) { // conditional GET @@ -76,9 +76,9 @@ class ProxyHttp @header('Vary: Accept-Encoding'); @header('Content-Disposition: inline; filename=' . basename($file)); - if ($expireFarFuture) { + if ($expireFarFutureDays) { // Required by proxy caches potentially in between the browser and server to cache the request indeed - @header("Expires: " . gmdate('D, d M Y H:i:s', time() + 86400 * 100) . ' GMT'); + @header("Expires: " . gmdate('D, d M Y H:i:s', time() + 86400 * (int)$expireFarFutureDays) . ' GMT'); } // Returns 304 if not modified since |