Bug 1845 - http-cache support with etag
Summary: http-cache support with etag
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal feature
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-28 12:05 UTC by Henryk Gerlach
Modified: 2012-05-13 05:01 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments
(33 bytes, text/x-diff)
2009-09-28 12:05 UTC, Henryk Gerlach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henryk Gerlach 2009-09-28 12:05 UTC
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.
Comment 1 Matt Mackall 2009-09-28 12:45 UTC
Please post this to the mercurial-devel list for discussion.
Comment 2 HG Bot 2010-09-08 08:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/f64b416b0ac8
Dirkjan Ochtman <dirkjan@ochtman.nl>
hgweb: support very simple caching model (issue1845)
Comment 3 Bugzilla 2012-05-12 09:03 UTC

--- 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)