diff -urp --strip-trailing-cr ../cacherouter/cacherouter.inc ./cacherouter.inc --- ../cacherouter/cacherouter.inc 2010-08-20 23:36:19.000000000 +0200 +++ ./cacherouter.inc 2010-09-01 22:39:49.000000000 +0200 @@ -175,7 +175,7 @@ function cache_clear_all($key = NULL, $t */ if (!function_exists('page_cache_fastpath')) { function page_cache_fastpath() { - global $base_root, $cache_router; + global $base_root, $cache_router, $conf; if (empty($_POST) && !isset($_COOKIE['DRUPAL_UID'])) { if (!isset($cache_router)) { @@ -184,28 +184,14 @@ if (!function_exists('page_cache_fastpat if ($cache_router->page_fast_cache('cache_page')) { $page = $cache_router->get($base_root . request_uri(), 'cache_page'); if (!empty($page)) { - drupal_page_header(); - - //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'); - } - } - - print $page->data; + header('X-Drupal-Cache: HIT'); + $conf['page_compression'] = substr($page->data, 0, 3) == "\x1f\x8b\x08"; + drupal_page_cache_header($page); return TRUE; } } } return FALSE; } -} \ Chybí znak konce řádku na konci souboru +}