gzip compression of BookMooch pages. Faster faster!

April 20, 2007


There’s a little-know trick for making big web pages download faster called “gzip compression”.

I’ve enabled this technique on many BookMooch pages.

The web server can choose to compress the web page with gzip compression, which typically makes it about 80% smaller, and the web browser decompresses it automatically. Since decompressing files like this is fast on modern computers, and it’s slower to download large files, this is a big win.

For example, the “browse by zip codes” page at BookMooch is 236k large, but gzipped it’s just 37k large (85% smaller) thus 6.5x faster to download.

Please do me a favor, and visit this page:

and leave a comment if the page *doesn’t* work for you.

For technical reasons too boring to go into here, only some of the pages at BookMooch are currently using this technique.

In programming BookMooch, there’s an “Easy way” to do this technique, which works with pages like the Browse Page. And, there’s the “hard way” that I have to do for pages like http://bookmooch.com/zip/07013.

It’s the “hard way” that I’m a bit nervous about, because I had to code that myself, whereas the easy way comes with the web server and thus “just works”, but not for a lot of the pages at BookMooch, which use another technology, and thus have to use the “hard way” to do it.

So…if no-one has any problems with http://bookmooch.com/zip/07013 then I’ll put this speed trick into place everywhere, and long pages at BookMooch will start to load faster.


If you’d like to see whether a page is compressed, use Firefox and install the “Live Headers” add-on from http://livehttpheaders.mozdev.org/.

With this add-on, when you choose “info” on a page, a new tab titled “headers” is now available. Click on that tab, and look for “Content-Encoding: gzip” on the bottom window (i.e. the “Response Headers”). If there’s no “Content-Encoding” then the trick is not being used on that page. You’ll also see the transferred size of the file (2022 bytes in this case) and if you save the file to disk, you can see what the real size is (12k in this case) and thus what the speedup was.

8 Responses to “gzip compression of BookMooch pages. Faster faster!”

  1. Wow. what a difference!


    (How does the browser know it’s compressed?)

    regards DaveP

  2. Joanna (msjoanna) said

    The zip code page did not load from my work computer. We’re behind a kind of lousy firewall, but probably not that uncommon for corporate settings. I’m forced to use IE6 as a web browser. When I try to go to the linked site, I get the “download this file” popup. If I download and save it, I still can’t open it.

  3. Drew said

    The page loads lightning-fast in Firefox!

  4. Matt said

    That page works fine for me (XP SP2/IE7). Not to complain, but FWIW Bookmooch is one of the slowest sites I use regularly, and I don’t think it’s due to the page load/transmission speed . . . it’s just slow, and I’m a bit concerned that gzipping pages, especially if it’s being done on the fly, will make it even slower, rather than faster.

  5. Elizabeth said

    It really works! 😮 There’s just ONE little problem. I’m the only one within my zipcode giving away books!!!!!!! Listen, you guys out there; if your zip is 29349, you need to be mooching books!!! And I’m not kidding!

  6. blissful2beme said

    loaded lighting fast for me.. cool.

  7. jefware said

    I am impressed with the speed that the pages download. Bookmooch is looking more rock-solid everyday.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: