In Example 2 of vcl_backend_response in the Varnish 4 example.vcl file, a conditional is used with req.esi_level.

There are two problems with this. First, req is not accepted in vcl_backend_response. Second, esi_level is not available in the response. Instead, X-Authcache should be used.

Attached is a patch that fixes this problem. I also updated the Varnish 3 example, since bereq can be used in vcl_fetch. This minimizes the amount of differences when migrating from Varnish 3 to 4.

Please review, thanks.

CommentFileSizeAuthor
authcache-varnish_esi_level_issue-1.patch1.62 KBsgdev

Comments

ron_s created an issue. See original summary.

znerol’s picture

That's correct. According to the 3.0 reference esi_level is only on req and that one is not available from vcl_fetch (search for the following phrase in the docs: The following variables are available after the requested object has been retrieved from the backend, before it is entered into the cache. In other words, they are available in vcl_fetch:.

Same is true for the vcl_backend_response in varnish 4.0. That one runs in the backend part of varnish and thus has no access to req.esi_level (which is a client side variable).

  • znerol committed 750bbe6 on 7.x-2.x authored by ron_s
    Issue #3055290 by ron_s: req.esi_level not accepted in...
znerol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.