ob_get_length() returns uncompressed buffer length (after ob_start('ob_gzhandler'))
| From: | daniel hahler | Date: | Mon, 20 Oct 2003 11:45:18 +0000 |
| Subject: | ob_get_length() returns uncompressed buffer length (after ob_start('ob_gzhandler')) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-166944@lists.php.net to get a copy of this message | ||
Hello PHP,
I found this small demonstration code on the net, that shows it really
good.
<?php
ob_start('ob_gzhandler');
print "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 30 a's
print "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; // 30 b's
print "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 30 a's
header('Content-Length: '.ob_get_length());
ob_end_flush();
?>
Call it with:
wget --header="Accept-Encoding: gzip" --header="Connection: close" -S http://localhost/test.php
on php-bugs I found that this is defined as "bogus", as the
compression takes place after all output is collected.
But I did not find an answer, how to correct this.. - using
ob_implicit_flush(); did also not help.
--
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc