8 Ways to Save Bandwidth on your RSS Feed

web

One of the things you will notice after you have published an rss feed is that it will consume a lot of the bandwidth. For example on Spendfish.com 18% of the requests are for RSS feeds. This is no wonder since feed readers may download your feed several times a day even if nothing has changed.

I've put together a list of ways you can save bandwidth and reduce the number of requests to your RSS feed (which also saves server processing).

1 - Use the ttl Tag

The ttl tag goes directly inside the channel tag in your RSS feed. It stands for time to live, and should hold the number of minutes a RSS reader should wait before requesting your feed again. Most blog software defaults this setting to 60, which means that your feed will be downloaded every hour by clients that obey this setting. We can increase this to 3 hours by adding the following:

<ttl>180</ttl>

Read more about ttl here

2 - Add a skipDays tag

The skipDays tag also goes inside the channel tag and should contain several child day tags. As you might guess this tells RSS readers to skip downloading your feed on the specified days. For example if you don't publish content on the weekends:

<skipDays>
  <day>Saturday</day>
  <day>Sunday</day>
</skipDays>

3 - Add a skipHours tag

Same idea as the skipDays tag, but allows you to specify which hours during the day your feed should not be downloaded. The hours are specified in 0-23 using GMT. For example since I'm in NY, and I typically don't post things to my blog very early in the morning I could add:

<skipHours>
  <hour>7</hour>
  <hour>8</hour>
</skipDays>

More info about skipHours and skipDays here.

4 - Support If-Modified-Since header

Many RSS readers and clients send an If-Modified-Since header in their request to your RSS feed. This is one of the ways clients make what's called a conditional HTTP GET, you can return a 304 Not Modified HTTP response code (and omit the request body) if the RSS feed has not changed since the date specified in the If-Modified-Since header. If the content has changed you simply return the normal 200 status code.

The header sent by the client might look something like this:

If-Modified-Since: Tue, 10 Jul 2007 21:19:55 GMT

Most clients will pass in the value you specify in the Last-Modified header, so you should make sure that header is being populated. More info here. ColdFusion If-Modified-Since example here.

5 - Support ETag and If-None-Match HTTP headers

The ETag header is a HTTP response header that you can send back in your RSS feed response. It stands for entity tag and should be a unique value representing the content, you could do a MD5 hash of your RSS feed content, or simply use a date time of the last change. Clients will send this back in a If-None-Match header, if this header contains your current ETag then you can return a 304 status code. More info about If-None-Match here.

6 - Don't send the request body on HTTP HEAD requests

Here's what HTTP 1.1 has to say about the HEAD method:

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.

The HEAD method should only return HTTP headers, and no request body (so you don't need to return your entire RSS for these types of requests). You will find that several aggregators and readers will make HEAD requests for your feed (including MXNA), it's a simple way to save some bandwidth.

7 - Limit the number of items you publish

This one is kind of obvious, but it is a very easy way to save bandwidth in your rss feed. If you are publishing 15 items or articles in your feed, if you lower that to 10 you can save a good amount of bandwidth.

8 - Publish Partial Content feeds

Another obvious way to save bandwidth - don't publish full articles in your feed. By publishing just the first few sentances of content you can also save a good amount of bandwidth. Your readers may not be too happy about this one however.


Do you have any other techniques that work? I considered adding Cache-Control, but I wonder if that would actually take away the savings you would get from a Conditional Get?

I have to thank Charlie Arehart for giving me the idea for this blog entry. After my Working with RSS in ColdFusion presentation at cfunited he suggested that I write a blog entry on ways to reduce the bandwidth consumption of your RSS feed. After doing the research for this entry I realize that this topic could the subject of an entire presentation!



Related Entries

18 people found this page useful, what do you think?

Trackbacks

Trackback Address: 642/DC8EEF459B84857B026AF307698E285A

Comments

On 07/12/2007 at 3:11:55 PM EDT Pete Freitag wrote:
1
Another good one that I forgot to mention is to send the feed back using GZip compression.

On 07/12/2007 at 3:34:20 PM EDT Mubashar Iqbal wrote:
2
Some great tips, thanks for sharing, one less reason to use FeedBurner :)

On 07/12/2007 at 3:53:55 PM EDT charlie arehart wrote:
3
Thanks for the mention, Pete, but more important, thanks for organizing the awesome info. I'm going to recommend this to the fine folks at performancing.com, a great blog with lots of useful tips for bloggers. This should be one of them! :-)

And yes, a talk on the topic would be a good idea. Perhaps no single CF user group would care to hear it, but the world of CF (and indeed all) bloggers would benefit. How about recording one with Connect (or Captivate/Camtasia/CamStudio) and then sharing it with the world? :-)

On 07/12/2007 at 5:20:59 PM EDT Ben Nadel wrote:
4
This is great. I especially like the skip hours one as I have some apps that don't get updates early mornings. Awesome.

On 07/13/2007 at 8:36:04 AM EDT Rob Wilkerson wrote:
5
Great tips. I've been preaching the support of If-Modified-Since and ETag/If-None-Match for a while. Those seem to be the biggest ones that are forgotten.

On 07/13/2007 at 9:32:27 AM EDT Roger Benningfield wrote:
6
Pete: There's one other option, though it's a bigger trade-off than the others.

Support for RFC3229+feed instance manipulation can shave tons of bandwidth with really huge feeds... Planet-type aggregated feeds, primarily.

For those who don't know, RFC3229 provides a way to deliver deltas via HTTP. In the case of Atom/RSS, it means the client sends along an "A-IM: feed" header with it's GET request. The server sees this, then checks If-None-Match and uses it to derive a subset of entries that are then returned to the client.

The idea is that the client only receives new entries that it hasn't seen before. Issues to bear in mind:

(1) Increased CPU utilization... instead of sending out one (presumably cached) feed to all clients, you're cooking up individual feeds (and database hits) for each reader.

(2) If your feed items contain lots of constantly changing meta info (comment counts and so on), then you're either going to have to keep resending updated entries (thus voiding the benefit of RFC3229), or drop the metadata.

(3) There's a temptation to just send feed deltas to everyone, requested or not... bad idea. There are still plenty of widget-style aggregators out there that expect to receive a full feed on every request.

On 07/19/2007 at 10:43:12 AM EDT Derek Versteegen wrote:
7
Unrelated to bandwidth, RSS is a great case for query caching. Customizing any of the popular CF Blogs to clear the query cache with every new post is easy enough and saves that much more time on the server side of things.

On 08/10/2007 at 12:22:35 PM EDT Mr. Apache wrote:
8
Great list! Tip #5 made the biggest difference for me by far..

@ http://www.askapache.com/htaccess/speed-up-your-site-with-caching-and-cache-control.html

On 08/28/2007 at 10:17:13 AM EDT Ben wrote:
9
you can also use rss caching:

http://www.rsscache.com

On 09/10/2007 at 4:12:49 AM EDT Nick Papanotas wrote:
10
Nice post. Personally when I faced bandwidth issues with our feeds I had success using the modified header and of course by using feedburner.

On 12/14/2007 at 6:53:48 AM EST J. Mihai wrote:
11
The sollution with http://www.rsscache.com is the best I have tested, I also like the grabber joomla has, yet that one is quite advanced also and its eating up too many resources.

Regards, J.Mihai http://www.jmihai.ro

On 12/17/2007 at 9:57:47 AM EST J. Mihai wrote:
12
Ummm, what do you think about rssframe catcher ? I had it installed on my http://www.petefreitag.com/item/642.cfm;http://www.jmihai.ro/blog as its a wordpress plugin. It was working nice in the footer and it was quite fast.

What do you think ?

Thanks, J.Mihai

On 10/21/2008 at 5:27:43 AM EDT A wrote:
13
Extremely helpful advice Pete!

A www.lucky-six.blogspot.com

On 11/18/2008 at 9:56:22 AM EST Superluke wrote:
14
There's an error in the SkipHours example in "step 3":

<skipHours> <hour>7</hour> <hour>8</hour> </skipDays>

The last "skipDays" should be "skipHours"

On 11/18/2008 at 9:56:39 AM EST Superluke wrote:
15
There's an error in the SkipHours example in "step 3":

<skipHours> <hour>7</hour> <hour>8</hour> </skipDays>

The last "skipDays" should be "skipHours"

On 08/31/2009 at 8:01:11 AM EDT Rindtaite wrote:
16
Here are the best new <b>Go Daddy codes</b>. I just used OK9 to renew some .com domains and it worked without a problem.

<b>OK7</b> - 10% Off Anything <b>OK8</b> - 20% Off $50 or More <b>OK9</b> - 30% Off .com Domains and Renewals

**Special Godaddy Coupon Valid til Aug 31, 2009. Godaddy Coupon <b>OK25</b> Save 25% on all Hosting plans or any order of $91 or more.

On 08/31/2009 at 8:09:58 AM EDT Rindtaite wrote:
17
Here are some of the newest valid <b>Godaddy promo codes</b>. I just used OK9 today to pick up some new domains and it worked awesome.

<b>OK7</b> - 10% off everything <b>OK8</b> - 20% off all orders of $50 or more <b>OK9</b> - 30% off .com Domain Registration

**Special Godaddy Coupon Expires on 08.31.09. Godaddy Promo Code <b>OK25</b> 25% off all hosting plans or any order of $91 or more.

On 02/26/2010 at 11:24:28 AM EST Monioutagitte wrote:
18
The response level to national disaster is awesome but it's a real shame that so many people take advantage of the sad situations.

I mean everytime there is an earthquake, a flood, an oil spill - there's always a group of heartless people who rip off tax payers.

This is in response to reading that 4 of Oprah Winfreys "angels" got busted ripping off the system. Shame on them! http://www.cbsnews.com/blogs/2009/08/19/crimesider/entry5251471.shtml

On 02/24/2011 at 11:17:47 PM EST Ray wrote:
19
These guys have .com's at only $8.49 per. Might help save you alittle mulah. :)

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?