What is the best way to detect when a feed has been updated? Say I have an application which polls the feed every 15 minutes. How do I find out if new content has been added or not? For RSS as well as Atom feeds.
Asked
Active
Viewed 4,298 times
3 Answers
6
Each item in RSS 2 and Atom has a GUID/ID that may be flagged as unique. If it's flagged as unique you can use it to identify items and match against the previous items.

Guffa
- 687,336
- 108
- 737
- 1,005
-
According to this http://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt the `guid` is an optional field so it may not be present in some RSS feeds ! – webNeat Mar 27 '15 at 20:08
5
Check the Last-Modified and ETag fields of the http response when requesting the field. Even better, use the If-Modified-Since and If-None-Match tags in your request, and you will only get a 304 response if the feed hasn't been modified. (see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)

Zed
- 57,028
- 9
- 76
- 100
-
2Do all website feeds support etags? And are etags easily read by javascript? – haden Aug 29 '09 at 06:15
1
I am using etags on my project, computed in a servlet filter as shown here http://www.infoq.com/articles/etags
This would work for rss, atom or any other resource hosted on your webserver.

seric
- 11
- 1