[PHP] gzip compression verification
I've enabled gzip compression of pages on my site. The question is, how do I check the size of the page being sent to verify that the page is being compressed. Danny __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gzip compression verification
Daniel Guerrier wrote: I've enabled gzip compression of pages on my site. The question is, how do I check the size of the page being sent to verify that the page is being compressed. pages will not always be compressed - they are delivered in compressed format only when the browser is willing to accept it that way. You can always find the number of bytes delivered by looking at the log file. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] gzip compression verification
I've enabled gzip compression of pages on my site. The question is, how do I check the size of the page being sent to verify that the page is being compressed. Check log of webserver; bytes sent is shown there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gzip compression verification
On Friday 09 July 2004 23:12, Daniel Guerrier wrote: I've enabled gzip compression of pages on my site. The question is, how do I check the size of the page being sent to verify that the page is being compressed. You can use an old version of Netscape (4.7X). If you view source of a compressed page that is exactly what you see - the compressed source ;) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I don't think so, said Ren'e Descartes. Just then, he vanished. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Gzip compression
I'm looking at implementing Gzip compression and output buffering. I think I have it working, but for some reason, the page isn't displayed for 8-10 seconds. It seems that the compressed page is sent immediately, but the browser hangs on to it for some reason. http://www.dvanhorn.org/Test/Index.php Compressed http://www.dvanhorn.org/Test/Index2.php Not compressed Here's the top level page code: ? ob_start(); include('gzdoc.php'); ? html head meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" meta name="description" content="Web Page Status" meta name="GENERATOR" content="Notepad" ? include("../headmeta.inc")? titleCurrent status./title ? include ("Header.inc")? /head body BODY BACKGROUND="../../Graphics/b_m.gif" ? include("Index.inc") ? ? include("../footer.inc") ? ? include("../do_webtrends.php") ? /body /html ? gzdocout(); ? There are NO chars before, or after, the PHP flags. Here is the contents of gzdoc.php. ? ob_start(); flush(); $debug="1"; $Level="4"; function CheckCanGzip(){ $ret = "0"; global $HTTP_ENCODING; if (headers_sent() || connection_timeout() || connection_aborted()) $ret = "0"; if (strpos($HTTP_ENCODING,'x-gzip') != false) $ret = "x-gzip"; if (strpos($HTTP_ENCODING,'gzip' ) != false) $ret = "gzip"; return $ret; } function GzDocOut($Level,$debug){ $ENCODING = CheckCanGzip(); if ($ENCODING){ print "\n!-- Use compress $ENCODING --\n"; $Contents = ob_get_contents(); ob_end_clean(); $Size = strlen($Contents); $Crc = crc32($Contents); $CContents = gzcompress($Contents,$level); $CContents = substr($CContents, 0, strlen($CContents) - 4); Header('Content-Encoding: '.$ENCODING); Header('Content-Length: ' . strlen($CContents)); Header('Content-Length: ' . strlen(ob_get_length)); echo $CContents; echo pack('V',$Crc) . pack('V',$Size); exit; }else{ ob_end_flush(); exit; } } ? -- Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9 -- 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] Gzip compression
At 04:24 PM 2/2/01 +0100, Dimitar Tsolov wrote: May be the reason is somewhere in your browser? I can see both pages /compressed and another one/ and I'm using Netscape 4.75 with Linux? They both get there, (I'm running latest MSIE) but I can't seem to work out why the delay between when the data stops coming in, and the page pops up. It may be that I'm not sending everything exactly the way the browser wants, but where it THAT documented? -- Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9 -- 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] Gzip compression
Actually you are right, I just try it with MSIE 5.0 and there is a delay? But on Netscape 4.75 is ok. May be the way of unziping the page is different? I donno?! David VanHorn wrote: At 04:24 PM 2/2/01 +0100, Dimitar Tsolov wrote: May be the reason is somewhere in your browser? I can see both pages /compressed and another one/ and I'm using Netscape 4.75 with Linux? They both get there, (I'm running latest MSIE) but I can't seem to work out why the delay between when the data stops coming in, and the page pops up. It may be that I'm not sending everything exactly the way the browser wants, but where it THAT documented? -- Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9 -- 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]