View previous topic :: View next topic |
Author |
Message |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Jul 26, 2006 8:45 pm Post subject: Gzip Compression Size. |
|
|
I've searched all over Google for this function or how to do it. All I get are these
tests showing you the uncompressed and compressed percentage of the page. I
want to know what these people use to perform these tests.
How do I get the compressed size of a Gzip page?
How do I get the uncompressed size of a Gzip page?
This will help me display a nice feature on my website on compressed Gzip
pages. I want people to be able to see Gzip in action!
Anyone who know's how to do this, please let me know. Thank You!
Sincerely, TRUSTAbyss |
|
Back to top |
|
 |
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Wed Jul 26, 2006 9:58 pm Post subject: |
|
|
Unfortunately, I don't think you can get a realtime web browser stat for Gzip bandwidth savings.
The tests done that I've run into on the net show website content that Gzip compresses. They ran this operation independent of a webserver. They just use a program like Winzip that Gzip's the files (that would be none other than Gzip). You could do the test manually and display the savings page by page (compare original with Gzipped version), though. _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Wed Jul 26, 2006 10:28 pm Post subject: |
|
|
Uh, download the gzip'ed page then decompress it and compare the sizes.
I think you'll have to write out the HTTP request manually rather than use file_get_contents or something, but other than that it shouldn't be hard. _________________
 |
|
Back to top |
 |
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jul 26, 2006 10:34 pm Post subject: |
|
|
Download a file with file_get_contents, save to a text file, get the size of the text file, and thats your uncompressed size :-) _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Wed Jul 26, 2006 10:52 pm Post subject: |
|
|
AbyssUnderground wrote: | Download a file with file_get_contents, save to a text file, get the size of the text file, and thats your uncompressed size :-) |
You would still need the response headers to know if it was gzip'ed in the first place or not, because as far as I know PHP will automatically decompress it.
Edit: That, or not send a header to say that it accepts gzip compression. _________________
 |
|
Back to top |
 |
 |
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Sat Jul 29, 2006 12:53 am Post subject: |
|
|
I have found a way to show real-time bandwidth savings by using G-zip. It is an approximation, and needs an external PHP file to do the work. The PHP file is requested. It displays the content (that is sent gzipped) and displays the bandwidth savings at the bottom.
Is anyone interested in this?
--------------------------
I believe this is what TRUSTAbyss was referring to. TRUSTAbyss wrote: | This will help me display a nice feature on my website on compressed Gzip pages. I want people to be able to see Gzip in action! |
_________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Aug 17, 2006 12:57 pm Post subject: |
|
|
Yes! That's exactly what I want. |
|
Back to top |
|
 |
|