Cache route doesn't check if compression of cached page is disabled or if browser accepts gzip.

In cacheroute.inc

184 if (function_exists('gzencode')) {
185 header('Content-Encoding: gzip');
186 }

I suspect it should be something like the following in include/bootstrap.inc

618 if (variable_get('page_compression', TRUE)) {
619 // Determine if the browser accepts gzipped data.
620 if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE && function_exists('gzencode')) {
621 // Strip the gzip header and run uncompress.
622 $cache->data = gzinflate(substr(substr($cache->data, 10), 0, -8));
623 }
624 elseif (function_exists('gzencode')) {
625 header('Content-Encoding: gzip');
626 }
627 }

I wish I had the time and knowledge to fix it, but I don't.

CommentFileSizeAuthor
#1 cacherouter_gzip.patch1.85 KBnick_vh

Comments

nick_vh’s picture

Assigned: Unassigned » nick_vh
Status: Active » Needs review
StatusFileSize
new1.85 KB

Fixed the compression check on the gzip.
Problem was that in the cache I couldn't check the variables so I checked if the content was gzipped or not.
I still need to test all the cache cases for this module but it seems to work for now, also if the browser doesn't support gzip compression it won't send the content compressed.

slantview’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.