inessential by Brent Simmons

RSS Bandwidth and Gzip compression

There are several ways to cut down on the amount of bandwidth your RSS feeds use.

The very best way is to make sure your server returns 304 Not Modified responses. (See HTTP Conditional Get for RSS Hackers for more details.)

But today I’m talking about another method (which should be used in addition to conditional Get): gzip compression.

The idea is simple: the server compresses the feed before returning it to your newsreader. This means less bandwidth is used because fewer bytes are transferred.

One of the nice things about this is that if a given newsreader doesn’t support gzip compression, a server will return an uncompressed feed, so you’re not locking anybody out. But it turns out that lots of newsreaders do support gzip compression, so it really is worth the effort. (Ted Leung has been maintaining a list of which newsreaders support it.)

Today I (finally) turned on gzip compression for my feeds. (Here’s a handy page you can use to check for gzip compression on any URL.)

Since my feeds are generated by PHP, I used Dean Allen’s super-easy instructions for turning on gzip compression. If your feeds are static files (which is probably the best choice) then you can probably use Apache’s mod_gzip or mod_deflate.