Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgweb_mod.py @ 13966:a1c31c64bcd3
hgweb: support disabling page cache
By default, hgweb_mod supports caching via the ETag header. This can
cause some confusion with browsers which cache aggressively. This change
preserves existing behavior while giving the administrator a knob to
disable the ETag header.
author | Steven Stallion <sstallion@gmail.com> |
---|---|
date | Wed, 20 Apr 2011 00:01:50 -0400 |
parents | 616ad3f6fd33 |
children | 44382887d012 4f39610996fa |
comparison
equal
deleted
inserted
replaced
13965:ac1c75a7c6b5 | 13966:a1c31c64bcd3 |
---|---|
186 | 186 |
187 if cmd == '': | 187 if cmd == '': |
188 req.form['cmd'] = [tmpl.cache['default']] | 188 req.form['cmd'] = [tmpl.cache['default']] |
189 cmd = req.form['cmd'][0] | 189 cmd = req.form['cmd'][0] |
190 | 190 |
191 caching(self, req) # sets ETag header or raises NOT_MODIFIED | 191 if self.configbool('web', 'cache', True): |
192 caching(self, req) # sets ETag header or raises NOT_MODIFIED | |
192 if cmd not in webcommands.__all__: | 193 if cmd not in webcommands.__all__: |
193 msg = 'no such method: %s' % cmd | 194 msg = 'no such method: %s' % cmd |
194 raise ErrorResponse(HTTP_BAD_REQUEST, msg) | 195 raise ErrorResponse(HTTP_BAD_REQUEST, msg) |
195 elif cmd == 'file' and 'raw' in req.form.get('style', []): | 196 elif cmd == 'file' and 'raw' in req.form.get('style', []): |
196 self.ctype = ctype | 197 self.ctype = ctype |