RSS feed being generated on demand.
As far as I can see, for I have 2 options for lastBuildDate - current time or pubDate.
Which one would you choose and why?
views:
27answers:
2The item having the newest PubDate should become the lastBuildTime.
[EDIT]: If there is a separate PubDate you are using too for whole feed, then lastBuildTime should be current time because you are building it at current time on-demand :).
[EDIT]: 2:: As lastBuildTime
is optional and you're anyways including PubDate for whole feed, why not remove it from your feed output?
According to the RSS 2.0 spec, lastBuildDate
is the last time the content of the channel changed. (I'm not entirely satisfied with this definition because what if the feed's meta data changes? I think the common convention is to update lastBuildDate
in that case, too.)
The channel-wide pubDate
is supposed to be used for the original publication date of the items in the feed. It is never a good value to use for lastBuildDate
because the pubDate is to stay unchanged even if the item gets updated.
Using the current time is the easy way out, but it's not perfect (because clients may start unnecessary operations due to the changed lastBuildDate
)
The best way would be to actually know / find out when the feed's content last changed, and output that.