diff options
author | Steve Clay <steve@mrclay.org> | 2012-10-29 20:59:21 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-11-15 01:42:15 -0500 |
commit | d857c68fd91b1bcf586a30d86108b1898c2bb2d3 (patch) | |
tree | 033f19e11177ee00451fe26cb3a1ebf44b53bbc3 /engine/handlers/cache_handler.php | |
parent | dca0df8297b578c85676b1ff868a2182981bee25 (diff) | |
download | elgg-d857c68fd91b1bcf586a30d86108b1898c2bb2d3.tar.gz elgg-d857c68fd91b1bcf586a30d86108b1898c2bb2d3.tar.bz2 |
Fixes #4895: Output valid ETag and Expires headers
Diffstat (limited to 'engine/handlers/cache_handler.php')
-rw-r--r-- | engine/handlers/cache_handler.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engine/handlers/cache_handler.php b/engine/handlers/cache_handler.php index b332ec379..7706c2c92 100644 --- a/engine/handlers/cache_handler.php +++ b/engine/handlers/cache_handler.php @@ -64,7 +64,7 @@ $ts = $matches[4]; // If is the same ETag, content didn't changed. $etag = $ts; -if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) { +if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == "\"$etag\"") { header("HTTP/1.1 304 Not Modified"); exit; } @@ -80,10 +80,10 @@ switch ($type) { break; } -header('Expires: ' . date('r', strtotime("+6 months")), true); +header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime("+6 months")), true); header("Pragma: public", true); header("Cache-Control: public", true); -header("ETag: $etag"); +header("ETag: \"$etag\""); $filename = $dataroot . 'views_simplecache/' . md5($viewtype . $view); |