diff --git a/includes/common.inc b/includes/common.inc index 43e2118..b8bc1af 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5063,7 +5063,12 @@ function drupal_page_set_cache() { } if ($cache->data['body']) { - if (variable_get('page_compression', TRUE) && extension_loaded('zlib')) { + // If page_cache_without_database is set, we always want to store the + // gzipped content. If page_compression is set to false, a cache hit + // will not load the variables from database and will deliver an + // uncompressed page with Gzip headers. + // See http://drupal.org/node/1476810 + if ((variable_get('page_cache_without_database', FALSE) || variable_get('page_compression', TRUE)) && extension_loaded('zlib')) { $cache->data['body'] = gzencode($cache->data['body'], 9, FORCE_GZIP); } cache_set($cache->cid, $cache->data, 'cache_page', $cache->expire);