11

All the information I could find regarding generating RSS feeds gives examples where an indeterminate number of items is returned.

That doesn't seem too practical, especially if I have a ton of entries and a ton of clients idly polling the feed.

Is there a magic number for how many items I should return? Should I just return everything I have?

4 Answers 4

14

I guess that depends on the type of information you syndicate, how often new items are added and the way your audience will use it.

If it's a news feed with dozens of new entries per day, 50 or 60 might be a good number, if it's only updated a few times per month or even less often, 20 will be more than enough.

If it's some kind of specialized information intended to be processed by other software, an entirely different number might be more appropriate.

1
  • Lots of good answers... can't quite decide which one to mark as answer, so I'm arbitrarily choosing this one to keep SO from nagging me. Thanks! Nov 15, 2010 at 1:58
5

There is no the magic answer here.

Just return some amount you think is enough.

In my user experience I've seen even feeds, that return 1 (one) item. As well as the ones, that returns ~100.

I think that the number of 20 is good compromise.

Also - you can rely on the period, not a specific number. In this case you could give the feeds added since last 24 hours, for example.

1
  • I like the period idea, but some of my feeds update very often and some very seldom -- so it's hard to determine. I'll do 20 for now. Nov 15, 2010 at 1:59
2

@Zerkms is correct IMO -> there is no magic number or industry standard, etc.

I feel like most people give a max of 20 items. If you want to be real tricky, give the consumer the option to specify the max number of items in the feed URL.

eg. http://www.yourWebSite.com/someFeed.rss?maxCount=whatever

It comes down to the content you are dishing up. Is it fresh/stale/a lot in a short period, etc.. ?

1

How many items should you give? Let's first answer another question: How many items can you give?

TLDR Answer

  • If you use RSS v. 0.91: use 15 items.
  • If you use RSS v. 1.00, v. 2.00, or later: use 100 items.

Your RSS Version Can Limit Your Items

If you are using RSS Version 0.91...

...a maximum of 15 items per channel is enforced at this time. (Source: RSS 0.91 Specification; emphasis mine.)

If you are using RSS Version 1.0, or 2.0, there is no limit that can be found in the specification. (Source: RSS 2.0 Specification.)

Should You Worry About Version 0.91's Limits?

Probably not, but maybe.

According to Wikipedia.com, based on data from 2007 (14 years ago)...

...the three main versions of RSS in current use are 0.91, 1.0, and 2.0, constituting 13%, 17%, and 67% of worldwide RSS usage, respectively.

Oddly enough, w3schools gives different numbers in 2015, which, based on their round numbers, are probably just guesses...

  • About 50 % of all RSS feeds use RSS 0.91
  • About 25 % use RSS 1.0
  • The last 25 % is split between RSS 0.9x versions and RSS 2.0 (Source: W3Schools.com.)

Handle All Cases

You can use the <description /> element in RSS to describe the feed, and here you can give useful information, like...

If you want this RSS feed in version 0.91, use this URL: example.com/news.rss?version=0.91

Then I just set the item count to 15 in this version. Otherwise I use about 100. This will only work if your RSS file is generated by a PHP file, which requires a little bit of back-end magic with .htaccess. But it provides a perfectly working RSS version for everyone.

Not the answer you're looking for? Browse other questions tagged or ask your own question.