diff mercurial/hgweb/hgweb_mod.py @ 12183:f64b416b0ac8

hgweb: support very simple caching model (issue1845)
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 08 Sep 2010 15:23:48 +0200
parents c327bfa5e831
children aa0d842b4f5d
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Wed Sep 08 15:11:35 2010 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Sep 08 15:23:48 2010 +0200
@@ -8,7 +8,7 @@
 
 import os
 from mercurial import ui, hg, hook, error, encoding, templater
-from common import get_mtime, ErrorResponse, permhooks
+from common import get_mtime, ErrorResponse, permhooks, caching
 from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 from request import wsgirequest
 import webcommands, protocol, webutil
@@ -178,6 +178,7 @@
                 req.form['cmd'] = [tmpl.cache['default']]
                 cmd = req.form['cmd'][0]
 
+            caching(self, req) # sets ETag header or raises NOT_MODIFIED
             if cmd not in webcommands.__all__:
                 msg = 'no such method: %s' % cmd
                 raise ErrorResponse(HTTP_BAD_REQUEST, msg)