Subject: Re: [PATCH 3/3] gitweb: use new Git::Repo API, and add optional caching

From: Jakub Narebski <[email-masked]>
Date: Tue, 15 Jul 2008 01:14:43 +0200

Lea Wiemann wrote:
> Jakub Narebski wrote:

> > Note that if caching is enabled, you can set expires to either
> > time-to-expire of cache entries (simpler), or time left to live to
> > invalidation of item in cache (better, but more complicated)
> 
> Gitweb's cache is actually never out-of-date, and cache invalidation
> happens automatically.  It uses some (long) expiry times to guard
> against non-standard modification of the repository, but it's nothing
> the HTTP client should be concerned with.

Could you explain then how gitweb cache is invalidated?

The _reasoning_ behind setting Expires:/Cache-Control: max-age= header
for gitweb with caching is that browser doesn't need to even try to
cache-validate or access page for the time we *know* that output would
not change[*1*] because it is from the cache.

[*1*] In significant way: changing relative dates/time doesn't count.

-- 
Jakub Narebski
Poland