Add RFC5005 support to WordPress-generated RSS feeds
-
RFC5005, “Feed Paging and Archiving”, is a standard from 2007 for publishing the complete history of an RSS (or Atom) feed. I would like WordPress to make full-history feeds available by default. I’ll explain why and then give some initial suggestions on implementation details.
Many people use WordPress to publish long-form serialized works like webcomics or serial stories, where reading the complete history of the work is necessary for understanding the newest posts. Readers of these works currently have to start by reading through the archive on the origin web site, and can only switch to their preferred RSS feed reading tools when they reach the end of what’s posted to date. Making the full history available in the RSS feed allows readers to consistently use the tools they prefer.
This isn’t as important for blog or news sites, where usually only the new content is relevant and older content is discovered through search or direct links. But I believe making full history available to third-party search tools and such is useful in that context too.
In the absence of a standard mechanism for feed history, people build all sorts of web crawlers to extract the information they want. (For example, a decade ago I built the web crawler that Comic Rocket uses to index about 10,000 sites.) Publishing full history using RFC5005 is better because it allows the publisher to decide things like whether to include full text or only a summary in the feed. Webcomic creators have long fought against having their comics scraped out of their sites because they need their ad revenue and want control over the presentation of their work. (So Comic Rocket is very conservative about what we index.) Supporting RFC5005 strikes a good balance between giving creators that control and letting readers use tools that meet their needs. Consuming RSS feeds is easier than writing web crawlers so making this history available in a standard form will encourage people to respect publishers’ wishes.
The easy part of implementing RFC5005 would be to support section 2, “Complete Feeds”. If WordPress generates an RSS feed that is not truncated (that is, there are fewer posts than the configured limit on syndication feed size), then it should add an
<fh:complete/>tag and the correspondingxmlns:fh="http://purl.org/syndication/history/1.0"namespace declaration.That change is enough for feed readers to recognize that if an entry disappears from a small feed, it’s because that entry has been deleted, not because it scrolled off the end of the feed. This is useful for those feed readers that save old entries.
When there are more posts than the configured limit on feed size, then section 4, “Archived Feeds”, comes into play instead. In this case, the primary RSS feed contains exactly the same contents it does today, with only the most recent N posts. However, it adds a
<link rel="prev-archive">tag to point to another feed containing some older posts. That in turn may point to a third feed, and so on. So feed readers that don’t care about RFC5005 work exactly as they do today, fetching only the most recent entries and ignoring the archive link.There are some tricky details because the archived feed at a given URL is not supposed to change in any “meaningful” way. It’s specified that way so that feed consumers can cache archive pages forever and avoid sending even conditional re-validation requests to the origin server. This means archived feeds can’t just correspond to the monthly posts view, in case a post is edited, deleted, or inserted deep in the archives; but it’s a huge efficiency win in the common case where the archives don’t change. If the WordPress team is open to supporting this standard, I have put a lot of thought into ways feed publishers can implement this specification correctly and I’d love to have a more extensive conversation about it.
I’m open to providing patches for this feature, given some guidance about what kind of implementation would be accepted and some advice on which part of the codebase it should go in. I haven’t written any significant PHP since the late ’90s but I can probably figure something out…
The topic ‘Add RFC5005 support to WordPress-generated RSS feeds’ is closed to new replies.