From 8cdb24c40a60e2a139d340cefa7b72db2f3f4c0c Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 17 Dec 2014 14:55:16 +1100 Subject: [PATCH] Might be a good idea to just always set the not modified header if we can --- modules/system/classes/CombineAssets.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php index 23e952ef0..44d6fea4d 100644 --- a/modules/system/classes/CombineAssets.php +++ b/modules/system/classes/CombineAssets.php @@ -154,19 +154,10 @@ class CombineAssets /* * Set 304 Not Modified header, if necessary */ - if ($this->useCache) { - $lastModifiedTime = gmdate("D, d M Y H:i:s \G\M\T", array_get($cacheInfo, 'lastMod')); - $response->setLastModified(new DateTime($lastModifiedTime)); - $response->setEtag(array_get($cacheInfo, 'etag')); - $response->isNotModified(App::make('request')); - } - /* - * The request has always expired - */ - else { - $response->header('Cache-Control', 'max-age=31536000, public'); - $response->header('Expires', gmdate('D, d M Y H:i:s \G\M\T', time() + 2678400)); - } + $lastModifiedTime = gmdate("D, d M Y H:i:s \G\M\T", array_get($cacheInfo, 'lastMod')); + $response->setLastModified(new DateTime($lastModifiedTime)); + $response->setEtag(array_get($cacheInfo, 'etag')); + $response->isNotModified(App::make('request')); return $response; }