bandwidth spikes and cache friendly headers

Graph of Bandwidth Usage for from October 10 2004 to November 9 2004 I knew while writing my blog entry for the Firefox 1.0 release that I’d see a spike in my bandwidth usage because of the large images I had in my post, but I didn’t expect anything like this! Thanks for dropping by and taking a look! I hope you took the hint and grabbed Firefox 1.0.

According to my account manager, I pushed approximately 1.1GB of data yesterday, which is more than I’ve pushed before in any single month.

Yesterday, shortly after posting my blog entry, I also set up cache-friendly headers to serve everything under in a way that doesn’t hit my server too hard. In short, the way it works is that I’ve used the Apache Expires module to instruct clients and caching proxies to cache images for one month from the date of the client pull. That means that if someone on AOL pulls an image from me, for one month, everyone on AOL who tries to pull that image doesn’t touch my server, and pulls it directly from AOL. It’s the next best thing to multicasting. It’s also cool because it reduces server load, because the images don’t generate requests on the Apache server. Not a big issue for me, but huge for those who are load limited rather than bandwidth limited. Here is a sample implementation using an .htaccess file:

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType video/x-ms-wmv A2592000
ExpiresByType video/mpeg A2592000
ExpiresByType application/pdf A2592000

For more detailed information, the Apache docs have good info for both 1.3 users and 2.0 users. Credit goes to yusufg for hooking me up with the above implementation. One can only wonder what my bandwidth graph would have looked like if every single person who viewed my blog entry hit the graphics.

4 thoughts on “bandwidth spikes and cache friendly headers”

  1. funtomas, you’re completely missing the point. This is especially useful for commercial use, because this is a way to cheaply minimise bandwidth usage. Companies care about page impressions, not hits on their web server. This is a way to have more page impressions with less resources.

  2. Hmmm, it’s a pity this module isn’t enable in a default Apache compile, I could make use of it. I guess I will have to try and remember it for the next upgrade.

Comments are closed.