<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Thank you for this confirmation !<br>
<br>
Now I know this is the same cache, I will move the ban block in the
main VCL !<br>
<br>
Thanks again !<br>
<br>
Regards,<br>
<br>
--<br>
<br>
Adrien Bigot<br>
<br>
<div class="moz-signature">
<div>
<link href="https://fonts.googleapis.com/css?family=Raleway"
rel="stylesheet" type="text/css">
</div>
</div>
<div class="moz-cite-prefix">Le 19/12/2019 à 16:14, Guillaume
Quintard a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAJ6ZYQy4WDkDOGt0UJCpJS-eZywijuYfhLWo8Ri=X+EHvj+4wQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>Hi,
<div dir="auto"><br>
</div>
<div dir="auto">Yes, labels are going to access the same cache
, exactly like a reloaded vcl is going to use the same cache
as the vcl it replaced.</div>
<div dir="auto"><br>
</div>
<div dir="auto">So, sending one request on any domain is going
to work, but wouldn't it be more straightforward to just
have the ban block in the main vcl, before you dispatch the
request to a sub vcl?</div>
<div dir="auto"><br>
</div>
<div dir="auto">Cheers,</div>
<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Dec 19, 2019,
15:07 Adrien Bigot <<a
href="mailto:adrien.bigot@smile.fr"
moz-do-not-send="true">adrien.bigot@smile.fr</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> 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 == "<a
href="http://front.mydomain.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">front.mydomain.com</a>")
{<br>
return (vcl(l_varnish_fronts));<br>
}<br>
if (req.http.host == "<a
href="http://api.mydomain.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">api.mydomain.com</a>")
{<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 href="http://myVarnishIP"
target="_blank" rel="noreferrer"
moz-do-not-send="true">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: <a
href="http://front.mydomain.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">front.mydomain.com</a>'
--header 'Cache-BanExpression:
obj.http.Cache-Tags-TeamCompetitionReference ~
(^|,)6847(,|$)' <a href="http://myVarnishIP"
target="_blank" rel="noreferrer"
moz-do-not-send="true">http://myVarnishIP</a><br>
curl -XBAN --header 'Host: <a
href="http://api.mydomain.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">api.mydomain.com</a>'
--header 'Cache-BanExpression:
obj.http.Cache-Tags-TeamCompetitionReference ~
(^|,)6847(,|$)' <a href="http://myVarnishIP"
target="_blank" rel="noreferrer"
moz-do-not-send="true">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>-- <br>
<br>
Adrien Bigot<br>
<div> </div>
</div>
</div>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">varnish-misc@varnish-cache.org</a><br>
<a
href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>