Long Grace setting for huge cache

Lars Jørgensen ljorg6 at gmail.com
Thu Sep 1 09:26:01 CEST 2011

On 01-09-2011 08:01, Erik Wickstrom wrote:
> I have a web application where the objects are expensive to generate
> (about 30 seconds),
> yet each individual object is accessed infrequently (a few times a
> week).  The dataset in total is larger than RAM.

How often do these objects change?

If they change infrequently, you might consider setting your cache for a 
very long ttl (like a year) and then have your backend purge objects 
from the cache as they are changed in the backend. That way you end up 
having everything in the cache (sooner or later), and everything in the 
cache always being the latest version.

This works well if the backend is pretty static.

Depending on how much you can control from your backend, you can purge a 
changed object from the cache and then request it to get a new version 
in there immediately and not inconvenience the first requesting user 
with a 30 second wait.


More information about the varnish-misc mailing list