[PATCH 2/2] Add a cache-snapshot-ttl configuration variable

Lukas Fleischer cgit at cryptocrack.de
Wed Feb 5 16:09:14 CET 2014

On Wed, 05 Feb 2014 at 15:44:36, Jason A. Donenfeld wrote:
> On Wed, Feb 5, 2014 at 10:46 AM, Lukas Fleischer <cgit at cryptocrack.de> 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

More information about the CGit mailing list