Only update etag and modified if the feed changed.
authorAdam Sampson <ats@offog.org>
Tue, 19 Aug 2008 15:09:32 +0000 (15:09 +0000)
committerAdam Sampson <ats@offog.org>
Tue, 19 Aug 2008 15:09:32 +0000 (15:09 +0000)
NEWS
rawdoglib/rawdog.py

diff --git a/NEWS b/NEWS
index 33e9d8881463d307d3669ce17ce2bb24b7e7a22c..ceaa89045ba850244b59268a24a846cb1b410dbd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ their replacements are.
 
 - rawdog 2.12
 
+Only update the stored Etag and Last-Modified when a feed changes.
+
 Add the "splitstate" option, which makes rawdog use a separate state
 file for each feed rather than one large one. This significantly reduces
 rawdog's memory usage at the cost of some more disk IO during --write.
index 47724bbc9fd321104b97b9865fc774be2518f0cb..dc36ded94b8c6be44ad1621598e97bfcf1b654cb 100644 (file)
@@ -402,15 +402,15 @@ class Feed:
 
                decode_structure(p, p.get("encoding") or "UTF-8")
 
-               self.etag = p.get("etag")
-               self.modified = p.get("modified")
-
                # In the event that the feed hasn't changed, then both channel
                # and feed will be empty. In this case we return 0 so that
                # we know not to expire articles that came from this feed.
                if len(p["entries"]) == 0:
                        return False
 
+               self.etag = p.get("etag")
+               self.modified = p.get("modified")
+
                self.feed_info = p["feed"]
                feed = self.url