sqlish queries for cache invalidation?

Nils Goroll slink at schokola.de
Tue Jan 23 18:43:48 UTC 2018


Regarding bans:

On 23/01/18 18:04, Dridi Boukelmoune wrote:
> "keys" that can be combined with each other with operators like "AND", "OR"
> or "NOT".

OR is just the same as several bans.

As any boolean expression can be converted to a disjunction (= OR semantics),
the existing '&&' operator with the existing comparison operators

    * ``==``: *<field>* and *<arg>* are equal strings (case sensitive)
    * ``!=``: *<field>* and *<arg>* are unequal strings (case sensitive)
    * ``~``: *<field>* matches the regular expression *<arg>*
    * ``!~``:*<field>* does not match the regular expression *<arg>*

should suffice to implement arbitrary logic based on

    * ``req.url``: The request url
    * ``req.http.*``: Any request header
    * ``obj.status``: The cache object status
    * ``obj.http.*``: Any cache object header

Nils

P.S. On a related issue, I got an open PR to add obj.ttl, obj.age, obj.grace and
obj.keep at https://github.com/varnishcache/varnish-cache/pull/2462


More information about the varnish-misc mailing list