Poul-Henning Kamp phk at
Wed Sep 5 11:34:29 CEST 2007

In message <46DE6D6A.90009 at>, Jeff writes:
>Poul-Henning Kamp wrote:

>>> If we want nice, pretty error messages, are we 
>>> >basically on our own, or is there an imminent plan for this?
>> I belive its on our list somewhere.
>Would it be possible to have an "error server" and then hack up some VCL 
>to "pass through" various errors to that server?  I.e, if the cache is 
>about to through back a 502 Bad Gateway, have some VCL that sets the 
>backend to pass from:

I'm not sure we know exactly how we want to handle it.

One option is to let people rewrite in vcl_error() and restart the
transaction with the (presumably) new url.

>> First of all, VCL is very efficient, so even very large maps in VCL
>> code will do well.
>> VCL also has an "include" facility, so you could machinegenerate
>> that part of your VCL program from your database.
>The list of names is not static; dozens of names are added or removed 
>throughout a given day, and the overhead of generating/loading a massive 
>static configuration file on every change would probably be prohibitive.

Ok, in that case, putting some relevant in-line C code in your VCL
file is probably your best bet.

This is intentionally not well documented, but cases like this is
what it is intended for.

The syntax is:

	whatever you want

and it gets copied through exactly at that place.

Use the varnishd "-C" option to see the result before compilation
and good luck :-)

>That would be pretty cool, and the ability to write arbitrary extension 
>functions in C would most likely lend itself to all sorts of other 
>creative uses.

See above :-)

>>> 5) We need to If-Modified-Since: revalidate back to the origin server on 
>>> every request, [...]

>Parsing M streams from a load-balanced cluster of Varnish servers into N 
>time-collated streams in something approaching real time, however, 
>sounds like a hard problem. :-)

Yes, that is probably true, although not impossible.

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