--- bootstrap.inc Sun Feb 22 18:07:27 2004 +++ bootstrap.inc Mon May 31 10:47:50 2004 @@ -85,7 +85,7 @@ function page_set_cache() { if (!$user->uid && $_SERVER["REQUEST_METHOD"] == "GET") { if ($data = ob_get_contents()) { - cache_set(request_uri(), $data, 1, drupal_get_headers()); + cache_set(request_uri(), function_exists('gzencode') ? gzencode($data) : $data, 1, drupal_get_headers()); } } } @@ -137,6 +137,15 @@ function drupal_page_header() { // Send appropriate response: header("Last-Modified: $date"); header("ETag: $etag"); + + // 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 + $cache->data = gzinflate(substr(substr($cache->data, 10), 0, -4)); + } + elseif (function_exists('gzencode')) { + header('Content-Encoding: gzip'); + } /* ** Send the original request's headers. We send them one after