When I publish a new blog post I add that post to my RSS feed by hand. Of course I sometimes make mistakes and only see them when the feed’s already uploaded. E.g. I forget to update the <pubDate> from what I have copy & pasted form the previous entry. Or I spot a spelling mistake. Or maybe I update the blog post later with new information.
Now the question is: How do I go about this in the RSS feed? How do you go about this?
Say I do want to update the post in my RSS file (I have done that before.), do I want to trigger a re-fetching of that post? (I have not done that before.) Would you even prefer that?
If I wanted to do that, how would I do that? Is there a tag that I could add for updates?
I tried to find this out already, but couldn’t find an answer. And I’m curious to find out how you handle this, if at all.
Thank you!
Edited because I forgot how to make the tag appear.
I’m operating off half remembered facts here, so take it as more of a leaping off point.
If I remember the RSS spec correctly, you add the last updated time in the header of the RSS page. Then it is up to the RSS client to decide whether or not to pull all the items below based on the last time it updated.
So, if you update the last edited time, it should trigger the RSS reader to refresh all the articles.
In terms of best practice about this. I don’t see any reason why updating the entries should be a problem. The only time I can imagine anyone getting upset about “faking” the time, unless you are trying to update the time to keep your posts at the top of peoples feeds.
So, edit the RSS items and update the last edited time all you like IMO
Thanks! I admit I do not have any date in the header, just in every individual item.
So I may put a <lastBuildDate> at the top (and try not to forget to edit it) and see how what that does.
In Atom, there are separate <updated> and <published> XML attributes that you can use to denote if you fixed a typo or whatever on a post-specific basis. Here is an example from the Jekyll feed plugin source:
But in an Atom or RSS feed, it doesn’t really make sense to speak of “fetching” an individual post conditionally on its published or updated date. RSS readers fetch the entire feed.xmlfile, which already includes the post text.
I view RSS feed construction as a “best effort” game. There will always be people (whether because they are new to RSS or just don’t care) who do weird things with the date fields that no RSS reader can anticipate. Likewise, I don’t know if you can force RSS clients to purge the old version of a post by adding an <updated> tag, for the same reason that you can’t force someone to press the refresh button if they are viewing a post in the browser.
As for what I do: I don’t define a “last updated” date at all… I just let Hugo apply its defaults, which I believe are like Jekyll’s: Last updated = published for all posts. This is not ideal, but it is only a problem if the edits between posts are major. My goal is to post in a more spontaneous fashion, so having an intricate system for tracking updates would only encourage perfectionism and undermine my site goals.
Thank you!
I was using the word “re-fetching” in regards to a post instead of the whole feed because I had made changes to an entry in my feed before that did not get updated when I told my feed reader to pull the feed again. I only saw the change when I unsubscribed and then re-subscribed. Also tech language isn’t one I’m particularly fluent in.
But reading your reply I do think it is time I got to find out what the difference between RSS and Atom actually is and then maybe set up an Atom feed to compare the two. Not that I expect to understand it all. But I like to at least try to understand stuff. Or at least get it to work somehow.
Which feed reader do you use? If it’s working properly, and your feed has the <updated> tag set up correctly, then you should not need to completely unsubscribe to get the updated version.
That said, the update may not always arrive instantly. At various steps along the way, your feed may be “cached” so that it is easier to retrieve, and these caches themselves can take some time to update.
I do not yet use the <updated> tag. I am only now trying to solve that problem, after having seen that updates to older posts in the xml file do not appear in my feed reader (Feedbro) when refreshing or after adding a new post to it.
I have also not yet added the <lastBuildDate> tag, that has been mentioned before, and that I also read about in @downgrade’s post/ ELPiS.
Thank you for all the tips and hints so far. I will try them out. I’m just not that quick.