From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Wed, 05 Feb 2014 16:09:14 +0100 Subject: [PATCH 2/2] Add a cache-snapshot-ttl configuration variable In-Reply-To: References: <1391593564-10662-1-git-send-email-cgit@cryptocrack.de> <1391593564-10662-3-git-send-email-cgit@cryptocrack.de> Message-ID: <20140205150914.15574.47084@typhoon.lan> On Wed, 05 Feb 2014 at 15:44:36, Jason A. Donenfeld wrote: > On Wed, Feb 5, 2014 at 10:46 AM, Lukas Fleischer wrote: > > This can be used to specify the TTL for snapshots. Snapshots are usually > > static and do not ever change. On the other hand, tarball generation is > > CPU intensive. > > > > One use case of this setting (apart from increasing the lifetime of > > snapshot cache slots) is caching of snapshots while disabling the cache > > for static/dynamic HTML pages (by setting TTL to zero for everything > > except for snapshot requests). > > > > I like this idea. But I don't think the default should be -1, since > that significantly changes the current behavior, and makes certain > tarballs get out of date perpetually, like downloading a zip of HEAD > or what happens when history is rewritten. Right, I didn't think of that. Only thought of the main use case which is downloading tagged snapshots. These are unlikely to change. I really wish we had some kind of intelligent caching as described in [1]. Using that, we could unquestionably use -1 as default everywhere. > > Currently it defaults to cache_repo_ttl, which is 5. I'd be willing to > compromise for 15 if you prefer. I'm fine with either one. Whatever you prefer. [1] http://lists.zx2c4.com/pipermail/cgit/2014-February/001974.html