Wordpress RSS bandwidth fixes
While checking my stats one day, I discovered that halfway through the month I had already sent out over 60 megs of data, just over RSS. Since I only have about 10 subscribers to my feed, this looked suspicious. Here’s what I did to fix it.
First, I turned on gzip encoding. It’s under Options->Reading. Of course, you’ll pay a slight CPU penalty if you enable this, as the server has to compress everything it sends out. But if bandwidth is an issue, this will help a lot; gzip will compress your feed by up to 80 percent or more. This option is off by default, so check to make sure it’s enabled.
Second, I fixed a couple of Wordpress bugs. The first bug I found was the lesser of the two. Some RSS readers and web spiders don’t cache the value they get back from the server for the Last-Modified header. Instead, when they request your feed they use the date and time they last retrieved the feed for the If-Modified-Since header. But WordPress does an exact comparison on the If-Modified-Since header with the date and time of the most recent post. Ooops. Most RSS readers cache the Last-Modified value so this isn’t very important. But check the link for a fix if you’re concerned about this.
The second bug is by far more serious. When attempting to connect to an RSS feed, well behaved RSS aggregators send the If-Modified-Since header to the server as part of the HTTP request. The server is supposed to respond with response code 304: Not Modified if nothing has been changed. Wordpress does this, but then sends the full text of the feed anyway! So no bandwidth was saved! At the rate I was serving feeds, it worked out to over 8 megs of wasted bandwidth per month, per RSS subscriber. Again, click the link for a fix.
UPDATE: The WordPress developers have fixed the full text RSS feed bug. So it’ll be fixed for the next version, and presumably the fix is showing up in the nightly builds now.
December 21st, 2004 at 1:40 pm
Wordpress RSS bandwidth fixes
Randy: Is this bug in the default setup of Wordpress?
December 21st, 2004 at 2:17 pm
[...] dth fixes slvShowNewIndicator(1103642261); Filed under: WordPress Tips|Google it! Wordpress RSS bandwidth fixes in 1.2, 1.2.1, and 1.2.2. [...]
December 21st, 2004 at 7:04 pm
WordPress bandwidth fixes
Nice info on bandwidth problems with WordPress, and easy to understand bug reports rock!
January 5th, 2005 at 4:24 pm
What versions of Wordpress do these bugs affect? 1.2, 1.2.1, 1.2.2, nightlies?
January 5th, 2005 at 9:03 pm
[...] rculosis.com 3) Looks like there are a couple of RSS bandwidth bugs in Wordpress, listed here. As of right now I’ve got bandwidth to spare an [...]
January 5th, 2005 at 11:48 pm
As I understand it affects versions 1.2, 1.2.1, and 1.2.2, and it was in the nightlies when I checked the bugs in. Presumably, the bugs are still in the nightly builds, because they haven’t been resolved yet.
January 30th, 2005 at 10:28 pm
[...] I made two changes to the RSS file for this weblog today to fix bandwidth bugs noted here. Things appear to be loading correctly, but please le [...]