# HG changeset patch # User Sylvain Thénault # Date 1265104067 -3600 # Node ID c1850ef961fce87ab8ec69ebeba4cb2bc029d3f8 # Parent c0f41f53f1c36a06621ca5a3bc680ee3d2926e5f simpler last_modified implementation diff -r c0f41f53f1c3 -r c1850ef961fc web/httpcache.py --- a/web/httpcache.py Mon Feb 01 18:55:47 2010 +0100 +++ b/web/httpcache.py Tue Feb 02 10:47:47 2010 +0100 @@ -111,14 +111,10 @@ mtime = self.req.header_if_modified_since() if mtime: tdelta = (ctime - mtime) - if tdelta.days * 24*60*60 + tdelta.seconds > self.cache_max_age: - mtime = ctime - else: - mtime = ctime - else: - mtime = ctime + if tdelta.days * 24*60*60 + tdelta.seconds <= self.cache_max_age: + return mtime # mtime = ctime will force page rerendering - return mtime + return ctime viewmod.View.last_modified = last_modified # configure default caching