Mercurial > SimpleWebPresenter
comparison CacheTimeCheck.inc @ 111:adf7b11921f4
No compression when debugging.
Synchronize caching headers.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Tue, 15 Mar 2016 12:55:42 +0100 |
| parents | d98e315308cd |
| children | df158368051e |
comparison
equal
deleted
inserted
replaced
| 110:6f5939bf53c3 | 111:adf7b11921f4 |
|---|---|
| 24 | 24 |
| 25 if ($_SERVER['REDIRECT_URL'] == '/sitemap.xml') { | 25 if ($_SERVER['REDIRECT_URL'] == '/sitemap.xml') { |
| 26 //print_r($gmdate_mod); | 26 //print_r($gmdate_mod); |
| 27 } | 27 } |
| 28 | 28 |
| 29 foreach($cache->cacheControl() as $header => $value) { | |
| 30 header ("${header}: ${value}"); | |
| 31 } | |
| 29 if(array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) { | 32 if(array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) { |
| 30 $HTTP_IF_MODIFIED_SINCE = $_SERVER['HTTP_IF_MODIFIED_SINCE']; | 33 $HTTP_IF_MODIFIED_SINCE = $_SERVER['HTTP_IF_MODIFIED_SINCE']; |
| 31 $if_modified_since = preg_replace('/;.*$/', '', $HTTP_IF_MODIFIED_SINCE); | 34 $if_modified_since = preg_replace('/;.*$/', '', $HTTP_IF_MODIFIED_SINCE); |
| 32 | 35 |
| 33 if (strtotime($if_modified_since) >= $cache->getNewest()) { | 36 if (strtotime($if_modified_since) >= $cache->getNewest()) { |
| 34 header("HTTP/1.0 304 Not Modified"); | 37 header("HTTP/1.0 304 Not Modified"); |
| 35 foreach($cache->cacheControl() as $header => $value) { | |
| 36 header ("${header}: ${value}"); | |
| 37 } | |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 foreach($cache->cacheControl() as $header => $value) { | 42 foreach($cache->cacheControl() as $header => $value) { |
