View Single Post
  #1 (permalink)  
Old 01-13-2004, 09:39 AM
Roscoe's Avatar
Roscoe Roscoe is offline
CC Member
Visit my Photo Gallery

 
Join Date: Mar 2000
Location: Fairfield, NJ, USA, NJ
Cobra Make, Engine: A & C, 351W, Tremec 3550. Exiled Member: Club Cranky
Posts: 5,897
Send a message via ICQ to Roscoe
Not Ranked     
Default Brent: Check this out

A Gzip Experiment

I found an interesting article by Scriptygoddess: Compressing Webpages for Fun and Profit. http://www.scriptygoddess.com/archives/003627.php

...What if I told you that you can third your content easily with no work on your part whatsoever? It sounds like a pitch I might get in a lovely unsolicited email. The secret lies in the fact that every major browser of the past 5 years supports transparently decompressing content on the fly.

The trick is to use some simple PHP code at the top of the page. This code compresses the content using gzip. But before sending the compressed content, it checks the header to make sure that the browser can uncompress it.

I made a copy of my main page that uses this technique. Please try it, and let me know (in the Comments) if you notice any speed difference. If so, I'll make the change to all of my pages. This technique seems to offer the best of both worlds: faster load times and reduced bandwidth. The difference, if any, will probably be most noticeable by dial-up users and those with slow connections.

Here's a site that lets you enter a URL, http://leknor.com/code/gziped.php and it will tell you if the document uses gzip encoded content. You'll find, for example, that Google and Slashdot use it.
__________________
Roscoe
"Crisis occurs when women and cattle get excited!"....James Thurber
Reply With Quote