gzip compressed pages
Posted: Tue Mar 08, 2005 9:58 pm
I'm glad to see that gzip can be used in s9y 0.8. But if on the server zlib.output_compression is set to On, you get an error message because it conflicts with ob_gzhandler. So an extra check for the zlib.output_compression should be added.
The following code fixes this:
The following code fixes this:
Code: Select all
function serendipity_gzCompression() {
global $serendipity;
if (isset($serendipity['useGzip']) && serendipity_db_bool($serendipity['useGzip']) && function_exists('ob_gzhandler') && extension_loaded('zlib') && ini_get('zlib.output_compression')!=1) {
ob_start("ob_gzhandler");
}
}