Stale RSS feeds?

Stale planet Before I created the planet (what a funny thing to write :-) I never looked at my RSS feeds, but now they’ve suddenly become very important. And they’re wrong! Or rather, the Etag and Last-Modified headers sent out are false, and so browser and feed aggregators wont be updated as they should.

Take a look at this trace caught with the excellent Live HTTP Headers plugin for Firefox — I’ve removed most of the other headers except for the Etag and Last-Modified headers. First I request Rune’s RSS feed for comments using Shift-”reload” to make Firefox bypass its own cache:

GET /?feed=comments-rss2 HTTP/1.1
Host: kirkebrand.dk
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 200 OK
Date: Wed, 25 Jan 2006 21:12:50 GMT
Last-Modified: Wed, 25 Jan 2006 09:14:20 GMT
Etag: "0dfff2fe5ab59c79c6105ac336b388ed"
Status: 200 OK

Bravo! We get the feed back.

I then posted a comment, which should update the feed. Reloading in Firefox looks like this where it does a conditional HTTP request by sending the Etag and Last-Modified headers along:

GET /?feed=comments-rss2 HTTP/1.1
Host: kirkebrand.dk
If-Modified-Since: Wed, 25 Jan 2006 09:14:20 GMT
If-None-Match: "0dfff2fe5ab59c79c6105ac336b388ed"
Cache-Control: max-age=0

HTTP/1.x 304 Not Modified
Date: Wed, 25 Jan 2006 21:13:54 GMT
Last-Modified: Wed, 25 Jan 2006 09:14:20 GMT
Etag: "0dfff2fe5ab59c79c6105ac336b388ed"
Status: 304 Not Modified

Hmm… that shouldn’t have been a 304 Not Modified, but a 200 OK with a new Last-Modified header and a new Etag! The funny thing is that when I press Shift and reload the page I and get the updated feed, but the headers still look like this:

http://kirkebrand.dk/?feed=comments-rss2

GET /?feed=comments-rss2 HTTP/1.1
Host: kirkebrand.dk
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 200 OK
Date: Wed, 25 Jan 2006 21:14:08 GMT
Last-Modified: Wed, 25 Jan 2006 09:14:20 GMT
Etag: "0dfff2fe5ab59c79c6105ac336b388ed"
Status: 200 OK

So something is definitely wrong here! I would be happy if some of you could try out the procedure above yourself and report your findings. I’ve seen this problem on my own blog and on Lars’ blog too, so the problem seems to affect version 1.5.2 as well as the new 2.0.

5 Comments

  1. Martin Geisler:

    Arrgh! The feeds have gone stale once again and so the planet lacks several witty comments :-(

  2. Thomas:

    Have you found the error?

  3. Martin Geisler:

    Nope, but I haven’t looked at the WordPress code either (the code for version 1.5.2 hurts my eyes, and I haven’t upgraded to 2.0 yet).

    Have you been able to confirm the traces I gave above? Please install the Live HTTP Headers plugin and try for yourself — then poke to your blog (make a post, make a comment) and see if the feed is updated correctly. If the feed is updated, then check that the Etag and Last-Modified headers have been updated too. If not, then it’s a bug!

  4. TreeFrog:

    Terrific Blog you have. Peace Out.
    TreeFrog

  5. JiggyWittit:

    Kewl blog you got goin on up here.
    Peace, JiggyWittit

Leave a comment