cache empties itself?
ottolski at web.de
Thu Apr 3 22:26:51 CEST 2008
Am Donnerstag 03 April 2008 21:45:25 schrieb Michael S. Fischer:
> On Thu, Apr 3, 2008 at 11:53 AM, Ricardo Newbery
<ric at digitalmarbles.com> wrote:
> > On Apr 3, 2008, at 11:04 AM, Michael S. Fischer wrote:
> > > On Thu, Apr 3, 2008 at 10:58 AM, Sascha Ottolski <ottolski at web.de>
> > > > and I don't wan't upstream caches or browsers to cache that
> > > > long, only varnish, so setting headers doesn't seem to fit.
> > >
> > > Why not? Just curious. If it's truly cachable content, it
> > > seems as though it would make sense (both for your performance
> > > and your bandwidth outlays) to let browsers cache.
> > Can't speak for the OP but a common use case is where you want an
> > aggressive cache but still need to retain the ability to purge the
> > cache when content changes. As far as I know, there are only two
> > ways to do this without contaminating downstream caches with
> > potentially stale content... via special treatment in the varnish
> > config (which is what the OP is trying to do) or using a special
> > header that only your varnish instance will recognize (like
> > Surrogate-Control, which as far as I know Varnish does not support
> > out-of-the-box but Squid3 does).
> Seems to me that this is rather brittle and error-prone.
> - If a particular resource is truly dynamic, then it should not be
> cachable at all.
> - If a particular resource can be considered static (i.e. cachable),
> yet updateable, then it is *far* safer to version your URLs, as you
> have zero control over intermediate proxies.
the reason is simple: the cache is for static images only. for some
reasons it works better for us to put reverse proxies in front to
lighten the requests to the real webservers (and the storage backend
they in turn need to access to deliver the images).
so, the cache shall be caching very agressive, but since the access to
the images is restricted, the TTL for upstream caches and browsers has
to be kept small.
obviously I still do not understand all the details of varnish, but I
thought it would "natural" that the cache can maintain a different TTL
for its objects than what is reported in the headers to upstream
however, my main problem is currently that the varnish childs keep
restarting, and that this empties the cache, which effectively renders
the whole setup useless for me :-( if the cache has filled up, it works
great, if it restarts empty, obviously it doesn't.
is there anything I can do to prevent such restarts?
More information about the varnish-misc