What is the difference between and in RSS?

前端 未结 5 857
栀梦
栀梦 2021-01-07 16:10

I have the feeling, in every RSS.xml file, both the pubDate and the lastBuildDate match.

I am sure that this one, is not always true...

So firstly, what is

5条回答
  •  醉话见心
    2021-01-07 17:00

    Answers here are all over the place. Some people are getting confused by the fact that item has a pubDate as well. I believe the OP is specifically asking about the difference between lastBuildDate and pubDate at the channel level.

    From the best of my understanding of the RSS spec, which is notorious for ambiguous explanations, lastBuildDate would be the last time the feed was created. For example, if you cache a copy of it on your server for some period of time, lastBuildDate would the time that cached copy was created.

    pubDate, on the other hand, seems to be basically the last time any actual content within the feed has changed. For the most part it's pretty much going to be the latest pubDate value from the items in the feed, since generally, the feed content is only changing when some new item gets published. However, it could also be a date when you made some change to the channel, itself, such as changing the channel title, description, etc.

提交回复
热议问题