make-fun
23rd April 2008, 05:57
Hi folks
I just came across a weird behavior — I don't seem to be able using the PHP ob_start("ob_gzhandler"); for compressing the output.
When throwing in a file like
<?php
ob_start("ob_gzhandler");
phpinfo();
?>
in /home/admispconfig/ispconfig/web/test.php
it results in
HTTP_ACCEPT_ENCODING gzip,deflateBut
Response Headers:
Date: Wed, 23 Apr 2008 02:08:43 GMT
Server: Apache
X-Powered-By: PHP/5.2.5
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
200 OK
When I put the same file in a normal user web it results in
HTTP_ACCEPT_ENCODING gzip,deflate
Response Headers:
Date: Wed, 23 Apr 2008 02:08:25 GMT
Server: Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a
X-Powered-By: PHP/5.1.2
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
200 OKSo here it does work as supposed.
For the admin panel it does not bother me too much, but when using Roundcube webmail it would be a great improvement, of course.
They try to use it when supported with this function:// set output buffering
if ($_action != 'get' && $_action != 'viewsource')
{
// use gzip compression if supported
if (function_exists('ob_gzhandler')
&& !ini_get('zlib.output_compression')
&& ini_get('output_handler') != 'ob_gzhandler')
{
ob_start('ob_gzhandler');
}
else
ob_start();
}
But have no luck here :(
Any ideas/help on that?
Thanks
I just came across a weird behavior — I don't seem to be able using the PHP ob_start("ob_gzhandler"); for compressing the output.
When throwing in a file like
<?php
ob_start("ob_gzhandler");
phpinfo();
?>
in /home/admispconfig/ispconfig/web/test.php
it results in
HTTP_ACCEPT_ENCODING gzip,deflateBut
Response Headers:
Date: Wed, 23 Apr 2008 02:08:43 GMT
Server: Apache
X-Powered-By: PHP/5.2.5
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
200 OK
When I put the same file in a normal user web it results in
HTTP_ACCEPT_ENCODING gzip,deflate
Response Headers:
Date: Wed, 23 Apr 2008 02:08:25 GMT
Server: Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a
X-Powered-By: PHP/5.1.2
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
200 OKSo here it does work as supposed.
For the admin panel it does not bother me too much, but when using Roundcube webmail it would be a great improvement, of course.
They try to use it when supported with this function:// set output buffering
if ($_action != 'get' && $_action != 'viewsource')
{
// use gzip compression if supported
if (function_exists('ob_gzhandler')
&& !ini_get('zlib.output_compression')
&& ini_get('output_handler') != 'ob_gzhandler')
{
ob_start('ob_gzhandler');
}
else
ob_start();
}
But have no luck here :(
Any ideas/help on that?
Thanks