diff --git cacherouter.inc cacherouter.inc index 0058494..28d6483 100644 --- cacherouter.inc +++ cacherouter.inc @@ -175,6 +175,7 @@ if (!function_exists('page_cache_fastpath')) { function page_cache_fastpath() { global $base_root; global $cache; + global $conf; if (empty($_POST) && !isset($_COOKIE['DRUPAL_UID'])) { if (!isset($cache)) { @@ -183,24 +184,14 @@ if (!function_exists('page_cache_fastpath')) { if ($cache->page_fast_cache('cache_page')) { $page = $cache->get($base_root . request_uri(), 'cache_page'); if (!empty($page)) { - drupal_page_header(); + header('X-Drupal-Cache: HIT'); - //checking if first chars are compressed (always the same pattern for every header) - if (substr($page->data, 0,3) == "\x1f\x8b\x08") { - - // Determine if the browser accepts gzipped data. - if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE && function_exists('gzencode')) { - // Strip the gzip header and run uncompress. - $page->data = gzinflate(substr(substr($page->data, 10), 0, -8)); - } - elseif (function_exists('gzencode')) { - //send gzip header to the browser - header('Content-Encoding: gzip'); - } + $conf['page_compression'] = substr($page->data, 0, 3) == "\x1f\x8b\x08"; + // Unserialize the cached page headers + if (isset($page->headers)) { + $page->headers = unserialize($page->headers); } - - print $page->data; - + drupal_page_cache_header($page); return TRUE; } }