Conditional caching question
phk at phk.freebsd.dk
Mon Jun 2 14:41:10 CEST 2008
In message <4841723E.2020109 at eastlink.ca>, David Pratt writes:
>Hi. In most cases, I want a request to be passed to a backend where it
>will be handled by server. If frequency is high, however; I want to add
>the object to varnish cache and have varnish handle it. I am not worried
>about a mechanism to keeping track of frequency of requests. Question is
>what is available to me to add an object/path to the varnish cache if it
>was originally passed?
That's the problem, we don't have any place to hold statistics for
objects that get "pass" treatment, so we would have no way of knowing
that a particular object was suitable for caching.
You could write a program that extracts that information from the
varnishlog on the fly (sort of like varnishtop), but then we need
a mechanism to get from there to tell varnishd that this or that
object should be cached from now on.
I wouldn't say that your way of using varnish is backwards relative
to the design objectives, but you do come close, since we assumed
caching by default, and pass as exception, rather than the other
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