Cache replacement/eviction policy?

Poul-Henning Kamp phk at
Wed Oct 3 09:34:40 CEST 2007

In message <4702D46E.4070805 at>, Gordon Mohr writes:
>Gordon Mohr wrote a while back (2007-09-20):
>> When all available cache space is used, and requests for new resources 
>> arrive, does Varnish discard older objects to make space for new? Is its 
>> policy for doing so configurable?
>> Thanks for any details/pointers,
>Still wondering if anyone can comment on this question.

We have an experimental LRU (Least Recently Used) facility that
will do just that.  For each candidate object, it will call the VCL
function vcl_discard() to ask if it is OK to ditch that object.

>Once upon a time I would have assumed the answer was something like "of 
>course, that's what a cache does", but responses like this one from DES 
>back in May gave me pause:

It's a quite new feature :-)

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list