RSS feed: how to recommend an update interval?

2019-01-19 16:59发布

问题:

When publishing an RSS feed, is there some attribute in the XML that can be used to recommend the update interval/frequency?

And if its not part of the standard, is there some generally recognised way?

回答1:

The specification here http://www.rssboard.org/rss-specification#requiredChannelElements has these optional parameters specified for the channel element:

These to tell clients when they don't need to update..

skipHours - A hint for aggregators telling them which hours they can skip. This element contains up to 24 < hour > sub-elements whose value is a number between 0 and 23, representing a time in GMT, when aggregators, if they support the feature, may not read the channel on hours listed in the < skipHours > element. The hour beginning at midnight is hour zero.

skipDays - A hint for aggregators telling them which days they can skip. This element contains up to seven < day > sub-elements whose value is Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday. Aggregators may not read the channel during days listed in the < skipDays > element.

and/or this for telling clients how often they need to update.

ttl - ttl stands for time to live. It's a number of minutes that indicates how long a channel can be cached before refreshing from the source.