How many entries in an RSS feed? And can I create pages for RSS feed?

StackOverflow https://stackoverflow.com/questions/23615944

  •  21-07-2023
  •  | 
  •  

Domanda

I am creating an RSS feed for a website I am working on. I read about RSS and it is pretty simple: It is a specially formatted XML file.

However, I could not find information about the following two questions

  1. Is there a limit to the number of entries/items in an RSS feed? Should I have 10 entries only? Or can I go up to 100 for example? What if I have more entries than 100 per day? What can I do?

  2. Can I have pages with each page displaying 10? So for example, www.emample.com/rss/ will give page 1, and www.example.com/rss/2 will give page 2 of RSS, and www.example.com/rss/3 will give page 3, and so on. The reason for this question is the following: If I am restricted to only 10 rss items, what happens if I have 50 items updated to the site since my last RSS update?

Thanks.

È stato utile?

Soluzione 2

Another option is to look at Atom, which is another format read by all modern readers transparently (no one will notice this is Atom or RSS). Atom has pagination as per this RFC. Generally, though, pagination is not widely used to say the least... so you probably don't need to bother too much!

Whether you pick RSS or Atom, it's useless to make your feeds "too large". Stick to a small-ish number of items, between 10 and 20, depending on how often you publish items.

Also think about implementing PubSubHubbub which is a fairly simple publish/subscribe protocol which will let anyone interested in your content know that a given feed has updated.

Altri suggerimenti

Is there a limit to the number of entries/items in an RSS feed? Should I have 10 entries only? Or can I go up to 100 for example? What if I have more entries than 100 per day? What can I do?

Depends on version of RSS used. If you're using the UserLand RSS 0.91 spec, for example, the number of item in a channel should be limited to 15 according to info in the RSS 2.0 spec. If you think of RSS as a format for periodic updates this makes sense—though it can be limiting.

If you look at jekyll-feed RubyGem—which uses Atom and is deployed on GitHub Pages sites—the number of posts is limited to 10. But you can do whatever your want as long as the spec permits.

For example, if you have more than 100 entries per day you're obviously going to want to increase the number and RSS 2.0 (and maybe Atom?) is fine with that. To signify to the RSS user agent the content is updated with a high frequency you can use the Syndication module to output time:

<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>

(Don't forget to add the XML namespace when using.)

Just keep in mind if you're using the Content module to output the full text of an an article in a CDATASection you're probably going to want to truncate some text if the sections are large.

Can I have pages with each page displaying 10?

Yes, though if you do you should probably have an RSS for your RSS to indicate the pages and use guid without a URL to ensure they're properly identified and deduped by the feed reader. This is also going to depend on the RSS user agent and what your desired results are.

And just for fun here are some modules for RSS 2.0 which make it very extensible:

xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"

Only use what you need and drop namespaces you aren't using.

RSS 2.0 Specification:

In RSS 0.91, various elements are restricted to 500 or 100 characters. There can be no more than 15 s in a 0.91 . There are no string-length or XML-level limits in RSS 0.92 and greater. Processors may impose their own limits, and generators may have preferences that say no more than a certain number of s can appear in a channel, or that strings are limited in length.

In RSS 2.0, a provision is made for linking a channel to its identifier in a cataloging system, using the channel-level category feature, described above. For example, to link a channel to its Syndic8 identifier, include a category element as a sub-element of , with domain "Syndic8", and value the identifier for your channel in the Syndic8 database. The appropriate category element for Scripting News would be 1765.

An RSS file is primarily used to tell subscribers when there's is new content on your site. You would generally set the number of s in your feed to reasonably accommodate the number of pages that change on a regular basis over a certain period.

If you want the SEs to know about your pages then another type of XML file would be suggested; site maps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top