diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -1052,6 +1052,8 @@ The full set of options is: To disable SSL verification temporarily, specify ``--insecure`` from command line. +``cache`` + Whether to support caching in hgweb. Defaults to True. ``contact`` Name or email address of the person in charge of the repository. Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty. diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -188,7 +188,8 @@ class hgweb(object): req.form['cmd'] = [tmpl.cache['default']] cmd = req.form['cmd'][0] - caching(self, req) # sets ETag header or raises NOT_MODIFIED + if self.configbool('web', 'cache', True): + 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)