sqlish queries for cache invalidation?

Guillaume Quintard guillaume at varnish-software.com
Tue Jan 30 16:10:21 UTC 2018


ban() takes a string :-)

ban("obj.http.xkey ~ " + req.http.banrgx);


-- 
Guillaume Quintard

On Tue, Jan 30, 2018 at 5:06 PM, Alexandros Kechagias <
alexandros.kechagias at gmail.com> wrote:

> Hi there,
> I have a question about your recommendation of banning caches with
> obj.http.xkey.
>
> I am also getting the following error from the compiler:
> 'obj.http.xkey': Not available in method 'vcl_recv'
>
> Also according to the documentation [1] I can only access "obj.*"
> inside vcl_hit[2] or vcl_deliver[3]
> and I feel like this is the wrong place to use ban to ban objects.
>
> I wanted to add this functionality into vcl_recv like:
>
>     if (req.method == "BAN") {
>         #  ACL purgers go here
>         ban(obj.http.xkey ~ req.http.banrgx);
>         return (synth(200, "Banned !"));
>     }
>
> Any suggestions?
>
> I use varnish-cache 5.2.1
>
> [1] variables in vcl subroutines :
> https://book.varnish-software.com/4.0/chapters/VCL_Basics.
> html#variables-in-vcl-subroutines
> [2] vcl_hit : https://book.varnish-software.com/4.0/chapters/VCL_
> Subroutines.html#vcl-vcl-hit
> [3] vcl_deliver :
> https://book.varnish-software.com/4.0/chapters/VCL_
> Subroutines.html#vcl-vcl-deliver
>
> Thanks
> Alexandros
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20180130/2a4a2322/attachment.html>


More information about the varnish-misc mailing list