Accessing original object in varnish background Fetch

Arunabha Saha arunabha.saha at gmail.com
Thu Mar 4 04:22:10 UTC 2021


Hello,
      Something I am trying to do is update an existing value in a
cached object after every background fetch.    I can't seem to figure
out how to access the existing object parameters during the background
fetch.

Example

vcl_backend_response {
      if (!bereq.is_bgfetch) {
            set beresp.http.myval = beresp.http.val_from_backend;
      } else {
             #
             #Here beresp.http.myval (on RHS of assignment expression).
             # should be the original hdr value stored with the object
but i can't seem to access it this way
             # or any other way.
             #
             set beresp.http.myval = beresp.http.myval +
beresp.http.val_from_backend;
      }
}

-- 
regards,
Arun


More information about the varnish-misc mailing list