Stale Bread Lunch

Literate and nerdy. By Michael James Boyle.

RSS Feed GUIDs

Mar 28, 2014 ∞

A brief programming note: If you were subscribed to my RSS feed just now, you probably got annoyed by seeing every item come back up as unread.1 The reason for this is I made a slight change to the way I generate the feeds which should, I hope, result in fewer future annoyances.

Basically, the RSS spec gives an opportunity to tag each item in the feed with a GUID which can by any snippet of text (optionally a permalink to the item) that uniquely identifies the post. Most readers that I’ve seen use this value to determine if a post is a new item or not. In other words, the body text can change completely, but if the GUID remains the same, it won’t appear as a new unread item in your reader.

I’ve noticed that in some feeds I subscribe to this causes problems (most particularly in Gruber’s). Sometimes he will publish a new item and then, very soon after initially publishing it, add a paragraph or fix a major problem in the post. My reader, however, will have cached the initial version, so even if I come to my reader long after he made the change, I’m unaware of the new content unless I see it on his site itself.

In an attempt to avoid this issue, I initially generated my GUIDs as the permalink plus the date of the most recent revision of the article. This has the effect of automatically pushing out a new version whenever the CMS sees the article as having been edited. This was a mistake.

Unfortunately, I underestimated the number of times I’d spot a small typo and want to go in and fix it. Suddenly I found myself wondering whether I ought to go in and capitalize something I’d accidentally put in lower case because I knew it would cause a new version of the article to appear in the feed. Sure, I’d like to have people read the fixed version, but if someone already read it, it hardly seems right to bug them with a new unread version in their reader over a change they would struggle to locate.

What I’ve done now is to add a custom field that allows me to append a version string on the end of the GUID. This way I can go in and make small fixes without triggering a new version in the feed, but if I make an update or a major factual correction, I can chose to flag the item to be pushed out fresh. I promise to be conservative with the use of this field.

This behavior still isn’t perfect. I’d love some way to make it so that minor corrections and typo fixes appear for anyone reading the article for the first time, even if the RSS reader cached it before I made the corrections, without making a new version appear as unread in someone’s reader who has already read it. But this seems like the best option given the available technology.

  1. Maybe even twice, because I’m stupid and published the change to the feed before spotting a small mistake. I’m very glad I’m doing this now when my readership approaches zero and not later. Sorry!