2006-05-30
tm
Could we have a $conf['usecontentlength'] configuration option (default: enabled)?
The idea is that every 'Content-Length' header printout should be wrapped around an
----------------------------------
if ($conf['usecontentlength']){
<print the Content-Length header>;
}
----------------------------------
The reasoning is that if you have these in php.ini (:
----------------------------------
output_buffering = Off
; Don't use output_handler
; output_handler =
zlib.output_compression = On
----------------------------------
and, optionaly, some zlib compression level like:
----------------------------------
zlib.output_compression_level = 3
----------------------------------
PHP does a wonderfull job at compressing output.
This can also be configured in regular .htaccess files, provided you have an Apache version that honours the syntax, like so:
----------------------------------
# Only if you use PHP
<ifmodule mod_php4.c>
php_value zlib.output_handler Off
php_value output_buffering Off
php_value zlib.output_compression On
php_value zlib.output_compression_level 3
</ifmodule>
----------------------------------
zlib.output_compression_level can be from 1 to 9, with 9 being the highest compression. Normal settings are usually between 3 and 6.
However, Dokuwiki calculated Content-Length values have touch with reality in such a setup.
The result is that content is compressed but takes forever to download
(I guess that eventualy some timeout kicks in and the download proceeds by ignoring the supplied Content-Length).
The proposed configuration option could be set to disabled when using the described PHP configuration to give DokuWiki great speed enhancements and low bandwidth consumption.
PS: There are 4 files that set Content-Length headers:
inc/HTTPClient.php
lib/exe/indexer.php
lib/exe/fetch.php
lib/plugins/plugin/inc/tarlib.class.php
but I can't tell for sure if this should apply to all of them ('lib/exe/fetch.php' and 'lib/exe/indexer.php' for sure).