Quote:
|
Do you know a web site where I can test to confirm if the page is compressed?
|
A late reply, but here you go:
http://leknor.com/code/gziped.php
Question:
Is the code given above needed?
Code:
if (headers_sent() != TRUE) {
$gz_possible = isset($HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])
&& eregi("gzip, deflate", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]);
if ($gz_possible) ob_start("ob_gzhandler");
}
According to this page:
http://www.php.net/manual/en/function.ob-gzhandler.php
just "ob_start("ob_gzhandler");" is enough.
Quote:
|
Before ob_gzhandler() actually sends compressed data, it determines what type of content encoding the browser will accept ("gzip", "deflate" or none at all) and will return it's output accordingly. All browsers are supported since it's up to the browser to send the correct header saying that it accepts compressed web pages.
|
Also, with the current version of PHP, is it still advisable to use the following class instead of ob_gzhandler?
http://leknor.com/code/php/view/clas...encode.php.txt
This is what the author said about PHP 4.0.5:
Quote:
// News: I had once said that when PHP4.0.5 comes out I will reccomend the built in
// ob_gzhandler over my code unless you are generating flash or images on the fly.
//
// I was wrong. PHP4.0.5 is out and ob_gzhandler doesn't work for me.
|