Re: how to determine size of gz-handler output
| From: | Christian Reiniger | Date: | Sun, 01 Jul 2001 08:16:17 +0000 |
| Subject: | Re: how to determine size of gz-handler output | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55718@lists.php.net to get a copy of this message | ||
On Saturday 30 June 2001 04:31, Richard Lynch wrote:
> >I'd like to know how small my content gets when i use
> >ob_gzhandler.
> Does gz-handler not provide any facility for measuring its performance
> or anything?... You'd think it would...
Using gzencode () should perform identical (compression ratio - wise) to
ob_gzhandler. So a
$PageZ = gzencode ($Page);
$PL = strlen ($Page);
$PLZ = strlen ($PageZ);
echo "Uncompressed : $PL<br>";
echo "Compressed: $PLZ<br>";
echo "Ratio: " . ($PLZ / $PL) . "<br>";
should do the job at the cost of a little overhead (page is compressed
twice).
--
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)
void sleep(){for(long int sheep=0;!asleep();sheep++);}