Page MenuHomePhabricator

$wgUseGzip is not working
Closed, ResolvedPublic

Description

Author: ilhan

Description:
I have added $wgUseGzip = true; to LocalSettings.php but it does not compress the pages.


Version: 1.16.x
Severity: normal
OS: FreeBSD
URL: http://krumovgrad.eu/wiki/

Details

Reference
bz26243

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:16 PM
bzimport set Reference to bz26243.
bzimport added a subscriber: Unknown Object (MLST).

Does your php include the zlib module? Not having that module is the most likely cause for compressing the output.

Browser ability is automatically detected and $wgUseGzip is no longer required.

BTW, what's Apashi Serv ? A localised version of Apache httpd?

ilhan wrote:

zlib 1.2.3 is included.

I'm already using gzip with PHP
(I use ob_start("ob_gzhandler"); at http://krumovgrad.eu/ )
Also check http://krumovgrad.eu/phpinfo.php

Yes, Apashi Serv is localized version of Apache httpd.

$wgUseGzip is no longer required? My other wiki is not gzip enabled by default too? metupedia.com

ilhan wrote:

Is there any workaround?

ilhan wrote:

Workaround: add ob_start("ob_gzhandler"); to the index.php.

$wgUseGzip is specifically for the old-fashioned local file-based caching, and is not used anywhere else. If you are not using $wgUseFileCache, then it will have no effect.

Things to check:

  • make sure $wgDisableOutputCompression has not been set to true
  • make sure MW_NO_OUTPUT_COMPRESSION has not been defined
  • check if the php.ini value zlib.output_compression is set funny -- if it appears to be on, MediaWiki disengages its own gzipping to avoid breaking
  • make sure PHP's zlib module is enabled -- we key off the 'gzencode' function, which must be present
  • make sure that nothing is forcing HTTP output to have started early, which will make it too late for the compression to engage
  • make sure that the HTTP Accept-Encoding header (as server variable HTTP_ACCEPT_ENCODING) makes it through to PHP intact -- if it's not present and listing 'gzip', no compression will be done.

ilhan wrote:

  • $wgDisableOutputCompression is set to false
  • MW_NO_OUTPUT_COMPRESSION has not been defined

I don't know about others. I'll make a new clean installation (without addons) and we'll see.

EN.WP.ST47 wrote:

How did the new installation work for you?

Aklapper lowered the priority of this task from Medium to Low.Mar 25 2015, 4:07 PM
Krinkle subscribed.

Seems to work on currently supported versions.