Discussion:
Setting a variable/header in vcl_recv and checking it in other sub routines
Md. Golam Hossain
2018-04-09 09:12:07 UTC
Permalink
If I want to make some decision by checking some header(eg:
req.http.test) in vcl_backend_response being set in vcl_recv but not
sent as http header while fetching from backend or while sending
response to client, how should I do this?

Let's say, I want to store all the objects that is set to 'true' in
req.http.test header in vcl_recv and check it in vcl_backend_beresponse
to store that object in "test.storage". But, as I am unsetting the
header(bereq.http.test) in vcl_backend_fetch, it can't be used in
vcl_backend_response while setting storage hint.

Any suggestion?
Thanks in advance.
req.http.test) in vcl_backend_response being set in vcl_recv but not
sent as http header while fetching from backend or while sending
response to client, how should I do this?
Let's say, I want to store all the objects that is set to 'true' in
req.http.test header in vcl_recv and check it in vcl_backend_beresponse
to store that object in "test.storage". But, as I am unsetting the
header(bereq.http.test) in vcl_backend_fetch, it can't be used in
vcl_backend_response while setting storage hint.
Any suggestion?
Thanks in advance.
Guillaume Quintard
2018-04-09 09:16:49 UTC
Permalink
Hi,

Use vmod_var, from varnish-modules. You'll store variables without setting
headers.
--
Guillaume Quintard
Post by Md. Golam Hossain
req.http.test) in vcl_backend_response being set in vcl_recv but not
sent as http header while fetching from backend or while sending
response to client, how should I do this?
Let's say, I want to store all the objects that is set to 'true' in
req.http.test header in vcl_recv and check it in vcl_backend_beresponse
to store that object in "test.storage". But, as I am unsetting the
header(bereq.http.test) in vcl_backend_fetch, it can't be used in
vcl_backend_response while setting storage hint.
Any suggestion?
Thanks in advance.
Post by Md. Golam Hossain
req.http.test) in vcl_backend_response being set in vcl_recv but not
sent as http header while fetching from backend or while sending
response to client, how should I do this?
Let's say, I want to store all the objects that is set to 'true' in
req.http.test header in vcl_recv and check it in vcl_backend_beresponse
to store that object in "test.storage". But, as I am unsetting the
header(bereq.http.test) in vcl_backend_fetch, it can't be used in
vcl_backend_response while setting storage hint.
Any suggestion?
Thanks in advance.
_______________________________________________
varnish-misc mailing list
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Loading...