thoughts about vcl cleanup around (be)resp.body and abandon/synth

Nils Goroll slink at schokola.de
Wed Nov 30 09:44:27 CET 2016


On 29/11/16 21:45, Federico Schwindt wrote:
> I will not object "unset beresp.body" but setting the body in the middle of
> vcl_backend_response{} feels odd to me.

This seems to be the item with the least consensus.

For the use case of replacing the body while keeping headers, the alternative is

- copy response headers to bereq or
  - use a vmod to save them
- resurrect them in v_b_e

While this is feasible, I sill don't understand why we would need a de-tour over
v_b_e just to create a synthetic body.

Why would we

- want  unset beresp.body;
- but not set beresp.body;

?

Both need to abort the backend connection or drain the request in progress, the
only difference would be if we end up with an empty ws non-empty object.

Nils

P.S.: Actually this is something which worked in varnish2, where one could just
call synthetic in vcl_fetch



More information about the varnish-dev mailing list