by
KK » Sun Sep 08, 2013 3:25 pm
Hi Paolo,
Couch internally uses
ob_start and
ob_end rather extensively. Using
ob_start("ob_gzhandler") sets the
ob_gzhandler function to handle the buffered output which will interfere with the working of Couch.
However that does not mean that one cannot use zip compression with sites running on Couch.
We can use the alternative 'zlib.output_compression' method (in fact PHP manual states that this method
is preferred over ob_gzhandler().).
There are three ways (in order of preference) of directing the web server to use this compression -
1. Via php.iniIt requires setting the following directive (if not already done by your hosting provider) in php.ini
- Code: Select all
zlib.output_compression = on
zlib.output_compression_level = 6
2. Via .htaccess If php.ini is off limits, we can alternatively try setting the following in the .htaccess file of your site's root folder (
not couch folder)
- Code: Select all
php_flag zlib.output_compression on
3. Via PHPFinally, as the last resort, try placing the following statements in Couch's
config.php- Code: Select all
ini_set( 'zlib.output_compression', 'On' );
ini_set( 'zlib.output_compression_level', '6' );
This way the server automatically checks for browsers that accept gzipped contents and does so transparently.
To verify that the server is indeed dishing out gzipped contents, you can use the resources listed here:
http://www.mydigitallife.info/how-to-te ... n-website/Hope this helps.