thoughts about vcl cleanup around (be)resp.body and abandon/synth
Dridi Boukelmoune
dridi at varni.sh
Tue Nov 29 17:28:11 CET 2016
> - rename vcl_backend_error to vcl_backend_synth to be consistent
> with the client side
I'd rather have both subroutines and distinguish between actual fetch
errors and artificial backend responses.
As a side note, at some point I remember discussing (with at least
phk) carrying the SLT_Error message in a bereq.error readable only
from v_b_e.
> - add status and reason to abandon which get pre-set for the call
> to vcl_synth
>
> 503 as default
+1, except for the default but I wouldn't mind it.
> - add return(backend_synth(status, reason)) to vcl_backend_fetch
> as an easy way to return synthetic content at backend request
> time.
I don't mind namespacing it, but I'd go for just synth.
> More thoughts:
>
> - if we want the (un)set beresp.body, should we maybe have
>
> set beresp.body = fetch()
>
> also?
What happens if I set the beresp.body several times with and without fetch()?
I actually need to check what happens today if you synthetic()/set
*resp.body more than once.
> This would be the default if no other beresp.body action happend
> in vcl_backend_response
I have trouble being convinced by the behavior, despite me being
previously in favor of being able to set beresp.body in v_b_r. After
two mental context switches it no longer seems like such a good idea
to me.
Cheers
More information about the varnish-dev
mailing list