How old is this RSS file?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am trying to parse some RSS files on my site to give a bit of news.
But some of the RSS are sometimes very old, (or just not updated anymore).

Is there a way of getting the age, (last updated), of a remote file?
I guess could always store the whole xml in the db and compare it every day  
to see when last it was updated.
But I was hopping there might be an easier way.

how can I tell how old the rss file really is?


Re: How old is this RSS file?

You can look at the <dc:date> element inside the <channel> element.
Not sure if this is required or not (it might not be), but it should
tell you when the feed was last updated (according to the author,

But whether you fetch the whole thing and compare it to the previous
day or fetch the whole thing and compare the date to your stored "last
updated" field, you still need to fetch the feed.  And, if you needed
to compare the whole file, so what?  You're only doing it once per day.

Re: How old is this RSS file?

"Simon" wrote:

Quoted text here. Click to load it

I assume you're using the Curl library to fetch the RSS file. Try setting
CURLOPT_HEADER in a curl_setopt() command, and look for a Last-Modified
header in the returned content. Obviously there's no guarantee that this
header will actually be present.

The best solution would be to keep a local cache of the RSS feed and note
the date when any changes are made to it.

phil [dot] ronan @ virgin [dot] net

Site Timeline