Streaming and backend conditional requests
Artur Bergman
sky at crucially.net
Sat Jan 14 19:54:08 CET 2012
On Jan 13, 2012, at 5:18 AM, Poul-Henning Kamp wrote:
> In vcl_fetch{} we add a "BOOL fetch_body()" function, so that you
> can insist on pulling the entire object from the backend, before
> accepting it into the cache, before deciding to deliver it to
> the client, or for doing (vmod-) modifications to it before delivery.
>
> If you do not call fetch_body(), only the headers are available in
> vcl_fetch{} and the body will be fetched asynchronously and delivered
> to any client hitting this object in parallel.
>
> vcl_error{} becomes vcl_synth{}, and you call it like:
>
> return(synth(202));
> return(synth(578, "You got to be kidding"));
> And the arguments go into resp.status and resp.response
>
> vcl_synth{} will only have access to req.* and resp.*, no obj.* or bere*.*
>
> Two issues need resolved:
> Can you cache synth objects ?
> Do they get delivered through vcl_deliver ?
>
> My initial idea was "no & no", but I am willing to be persuaded otherwise,
> and Artur may be halfway there already.
>
> The argument for no caching is simply that Varnish is not a webserver
> and I'd hate to see people try to turn it into one.
>
> The second is more involved: Synth replies will not have an obj.*
> and therefore delivery is mechanically quite different from an obj.*
> based delivery. Also, we won't be doing gunzip or ESI on synth
> replies.
Couple of points.
I agree with all, except I think they should be delivered through vcl_deliver, or you have to duplicate header logic in both of them.
Regarding ESI, as long as an ESI can have an fragment be a synth reply, I am happy.
Artur
More information about the varnish-dev
mailing list