Description:
I have enabled PHP's zlib.output_compression with the following lines in php.ini:
---------------------
zlib.output_compression = On
zlib.output_compression_level = 3
---------------------
Testing both dokuwiki-2007-05-11 (developer) and dokuwiki-2006-11-06 (stable) I discovered that occasionally I get a strange response under Firefox 2.0 when it pops-up a dialog box stating that the response from that server was of type application/octet-stream and asking what I want to do with it.
The attachment contains headers like:
---------------------
[***Binary Data***]HTTP/1.1 200 OK
Date: Fri, 11 May 2007 06:39:49 GMT
Server: Apache/1.3.29 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.16 OpenSSL/0.9.7g
Set-Cookie: DokuWiki=915f62a42051cc078860991fc978eeb3; path=http://www.liritis.eu/docs-en/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: DWb55294010f611e5357d1b8ba9309ede5=deleted; expires=Thu, 11 May 2006 06:39:49 GMT; path=/
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
556
[***Binary Data***]
---------------------
Unfortunately it is not repeatable as I may request the same page 3-4 times before I get this result and there seems to be no pattern in it. Note that this happens regardless if $conf['gzip_output'] is On or Off. Furthermore, I can't say if this is a bug with PHP, the browser or DokuWiki.
The
---------------------
Content-Encoding: gzip
Vary: Accept-Encoding
---------------------
headers above indicate that this output comes from PHP's zlib.output_compression in response to the browser sending
---------------------
Accept-Encoding: gzip
---------------------
Ugly fix:
I tried disabling zlib.output_compression in inc/init.php by adding a
---------------------
ini_set('zlib.output_compression', 'Off');
---------------------
line just before
---------------------
// enable gzip compression
---------------------
and all worked fine, regardless of the $conf['gzip_output'] setting.
Requested fix:
Please turn $conf['gzip_output'] from boolean into number, with 0 remaining the default.
The new gzip_output options should be:
0
don't use ob_gzhandler
and disable zlib.output_compression
1
use ob_gzhandler
but disable zlib.output_compression
2 (new)
don't use ob_gzhandler
and don't disable zlib.output_compression
and don't output Content-Length headers (as per
http://bugs.splitbrain.org/?do=details&task_id=818&histring=zlib.output_compression)
Alternatively, just hardcode that zlib.output_compression and let ob_gzhandler be the only alternative for compression.