WHAT This patch implements rudimentary http-cache-handling for mercurial. WHY While mercurial is rarely a high traffic application a few sites could still profit from setting correct headers for caching. Correct caching makes reverse-proxys more efficient and enables the site to be cached by a distributed caching network like nyud.net. RSS and ATOM feeds might profit from the caching as well. Less traffic means less energy wasted and the trees smile. ;) HOW The patch adds ETag headers to most responses. By default the ETag is generated as a hash of all heads of the repository and a configurable cache_salt. If a client knows the ETag he gets a "304 Not Modified". Changing the heads or changing the salt invalidates all cached pages. For the /archive command the ETag is computed using the corresponding revision and the salt, i.e. it does not change when the heads change. WHAT COULD BE IMPROVED? 1. More (if not most) commands could compute the ETag from the corresponding revision id instead of the ever changing heads. 2. Commands refering to shortnodes or tags (especially tip) could be temporarly redirected to the "long" nodes because those urls stay longer valid.
Please post this to the mercurial-devel list for discussion.
Fixed by http://hg.intevation.org/mercurial/crew/rev/f64b416b0ac8 Dirkjan Ochtman <dirkjan@ochtman.nl> hgweb: support very simple caching model (issue1845)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:03 EDT --- This bug was previously known as _bug_ 1845 at http://mercurial.selenic.com/bts/issue1845 Imported an attachment (id=1268)