[PHP] how to determine size of gz-handler output
Hi all I'd like to know how small my content gets when i use ob_gzhandler. so far i tried $cont=ob_get_contents(); $length=strlen($cont); echo "\n"; but it outputs while apache says in its logfile: 217.81.41.121 - - [29/Jun/2001:12:43:59 +0200] "GET / HTTP/1.1" 200 2028 i'm starting to get confused... Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to determine size of gz-handler output
Hi Sebastian! On Fri, 29 Jun 2001, Sebastian Stadtlich wrote: > Hi all > > I'd like to know how small my content gets when i use > ob_gzhandler. > so far i tried > $cont=ob_get_contents(); > $length=strlen($cont); try using $length = ob_get_length(); instead. > echo "\n"; > > but it outputs > -- teodor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to determine size of gz-handler output
>I'd like to know how small my content gets when i use >ob_gzhandler. >so far i tried >$cont=ob_get_contents(); >$length=strlen($cont); >echo "\n"; > >but it outputs > > >while apache says in its logfile: >217.81.41.121 - - [29/Jun/2001:12:43:59 +0200] "GET / HTTP/1.1" 200 2028 [WILD GUESS ALERT!] I'm guessing the gzip part happens "in place" as the data is being streamed to the browser, not before you call ob_get_contents. If so, you now have one data point. Your 17280-character string gets turned into 2028 (?) bytes??? To see if this is maybe a correct thesis, snag the HTML output, and run gzip on it, and see if it's 17,280 bytes before and 2028 after. So maybe there's no real way to know what the compressed size is... Unless you want to try to match up your log file entries with your ob_get_contents measurement above. Does gz-handler not provide any facility for measuring its performance or anything?... You'd think it would... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to determine size of gz-handler output
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"; echo "Compressed: $PLZ"; echo "Ratio: " . ($PLZ / $PL) . ""; 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++);} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how to determine size of gz-handler output
as far as i know, $cont is not GZ compressed so you're getting the length of the uncompressed data. the contents only get compressed right before sending output to the browser... > -Original Message- > From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 29, 2001 6:54 AM > To: 'Php-General (E-Mail) > Subject: [PHP] how to determine size of gz-handler output > > > Hi all > > I'd like to know how small my content gets when i use > ob_gzhandler. > so far i tried > $cont=ob_get_contents(); > $length=strlen($cont); > echo "\n"; > > but it outputs > > > while apache says in its logfile: > 217.81.41.121 - - [29/Jun/2001:12:43:59 +0200] "GET / HTTP/1.1" 200 2028 > > i'm starting to get confused... > > Sebastian > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]