varnish / varnish-modules

Collection of Varnish Cache modules (vmods) by Varnish Software
Other
182 stars 86 forks source link

Consistent Example #78

Closed bigcurl closed 6 years ago

bigcurl commented 7 years ago

Header name was different in vcl then in calling example.

andrerom commented 7 years ago

Afaik the VCL should be:

        if (req.http.xkey) {
        set req.http.n-gone = xkey.purge(req.http.xkey);
        # or: set req.http.n-gone = xkey.softpurge(req.http.xkey)

(the header needs to be the same as in the if, today it says xkey, and purge is done using key)

And the example is indeed wrong, it can be updated to be aligned with the VCL:

     PURGE / HTTP/1.1
     Host: www.example.com
     xkey: 166412

 Note on PURGE: As example VCL shows it is important to protect
 this with an ACL so random people from the Internet cannot purge your
 cache.
lazyatom commented 6 years ago

The RST documentation should also be updated.