VCL and Non-Existent Backend Objects

Dag-Erling Smørgrav des at
Fri May 11 10:55:17 CEST 2007

James Quacinella <james at> writes:
> I was contemplating a setup such as this:
> 1) Client requests xml file from varnish cache
> 2) If it exists, fine; else check backend file server running lighttpd
> 3) If it exists on the backend, again no problem; however, if it
> doesn't exist on the lighttpd backend, I need varnish to check another
> (dynamic) backend, which will dynamically generate it and save it on
> the lightttpd backend for future purposes.
> Does anyone have any ideas on how to implement that via VCL? I would
> imagine I would need to be able to see the response headers from the
> original backend, to see if a 404 is generated (like here

I don't think this is supported in the current code base.  Poul-Henning
and I discussed something similar on Monday - the ability to restart a
request, possibly after modifying it a little.

There was also some talk at some point of adding some kind of "policy
check" functionality - the ability to perform a secondary HTTP request
from VCL code, e.g. to check a user's credentials before serving a
cached document which requires authorization, rather than just passing
the entire request on to the backend.

Mind you, these are just ideas - we have no concrete plans to implement
any of this in the near future.  We are currently ramping up work on
2.0, and will most likely be busy with that until fall.

Dag-Erling Smørgrav
Senior Software Developer
Linpro AS -

More information about the varnish-misc mailing list