How to compare 'bereq.backend' and 'req.backend_hint' against a director/backend in Varnish 4.1

Plöger, Ronald ronald.ploeger at gmx.de
Fri Dec 16 14:22:17 CET 2016


Hi Dridi,

thanks for your comment.

> I'd like to stress one more time that comparing bereq.backend to
> d1.backend() is likely to always fail because in the backend context
> you will should the resolved backend.


 From the log output for:

std.log("xxxxxxxx-vcl_backend_response-bereq: " + bereq.backend);
std.log("xxxxxxxx-vcl_backend_response-beresp: " + beresp.backend);
...	
std.log("xxxxxxxx-vcl_deliver: " + req.backend_hint);


**** v1    1.0 vsl|       1002 VCL_Log         b xxxxxxxx-vcl_backend_response-bereq: d1
**** v1    1.0 vsl|       1002 VCL_Log         b xxxxxxxx-vcl_backend_response-beresp: b1
...
**** v1    1.0 vsl|       1001 VCL_Log         c xxxxxxxx-vcl_deliver: d1

I got the impression that both "req.backend_hint" and "bereq.backend" hold the director (because they both output "d1") and that only "beresp.backend" holds the backend (because it outputs "b1").
Therefore I assumed that a comparison against "d1.backend()" would work for "req.backend_hint" and "bereq.backend" but not for  "beresp.backend".

Best,
Ronald

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20161216/760cab08/attachment.html>


More information about the varnish-misc mailing list