<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hello,<br>
<br>
I plan to use labels on a Varnish stack in front of multiple
backends.<br>
I have a question about ban with multiple labels. <br>
<br>
My main.vcl will route requests in function of Host header for
example like this : <br>
<br>
if (req.http.host == "front.mydomain.com") {<br>
return (vcl(l_varnish_fronts));<br>
}<br>
if (req.http.host == "api.mydomain.com") {<br>
return (vcl(l_varnish_api));<br>
}<br>
<br>
<br>
When we want to ban objects we do it with a HTTP BAN method on each
varnish server. Varnish handle it the BAN request like that in each
label's VCL file :<br>
sub vcl_recv {<br>
if (req.method == "BAN") {<br>
<br>
if (req.http.Cache-BanExpression) {<br>
ban(req.http.Cache-BanExpression);<br>
}<br>
return (synth(200, "Banned"));<br>
}<br>
<br>
<br>
My question is if I want to purge contents like this : <br>
<br>
curl -XBAN --header 'Cache-BanExpression:
obj.http.Cache-Tags-TeamCompetitionReference ~ (^|,)6847(,|$)'
<a class="moz-txt-link-freetext" href="http://myVarnishIP">http://myVarnishIP</a><br>
<br>
Will them be banned for all my Labels (if I include the proper vcl
code in main.vcl), or do I have to make a request for each label
like : <br>
curl -XBAN --header 'Host: front.mydomain.com' --header
'Cache-BanExpression: obj.http.Cache-Tags-TeamCompetitionReference ~
(^|,)6847(,|$)' <a class="moz-txt-link-freetext" href="http://myVarnishIP">http://myVarnishIP</a><br>
curl -XBAN --header 'Host: api.mydomain.com' --header
'Cache-BanExpression: obj.http.Cache-Tags-TeamCompetitionReference ~
(^|,)6847(,|$)' <a class="moz-txt-link-freetext" href="http://myVarnishIP">http://myVarnishIP</a><br>
<br>
<br>
In fact, I want to know if the cache is mutualized between labels ?
If yes, is a solution exists to purge contents in all labels without
sending multiple BAN requests ?<br>
<br>
Thanks in advance.<br>
<br>
Best regards,<br>
<br>
<div class="moz-signature">-- <br>
<br>
Adrien Bigot<br>
<div>
<link href="https://fonts.googleapis.com/css?family=Raleway"
rel="stylesheet" type="text/css">
</div>
</div>
</body>
</html>