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.
3 Answers
6
votes
4
votes
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)
1
votes
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.