varnish / varnish-modules

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

Getting Error 200 Guru Mediation Error on Purging using x-key #210

Closed Aadarsh-Verma closed 1 year ago

Aadarsh-Verma commented 1 year ago

I get the following response on purging using x-key image

I have used the file storage backend using this : varnishd -F -s disk=file,/var/lib/varnish/varnish_storage.bin,1G -f /etc/varnish/default.vcl -a:6085 and my purging logs are : `

` Don't know why my storage is malloc Transient in this case when I am using file type storage backend could be the source of the issue

my VCL file is

` sub vcl_recv { if (req.method == "PURGE") {

    if (req.http.x-key) {
    set req.http.n-gone = xkey.purge(req.http.x-key);
    # or: set req.http.n-gone = xkey.softpurge(req.http.xkey)
    return (synth(200, "Invalidated "+req.http.n-gone+" objects"));
    } else {
    return (purge);
    }
 }

}

sub vcl_backend_response { // set beresp.storage = disk; set beresp.ttl = 0s; if(bereq.url ~ "date"){ unset beresp.http.Cache-Control; set beresp.http.Cache-Control = "public"; set beresp.ttl = 10m; set beresp.http.x-key = "date"; std.log("setting cache-control"); } } `

gquintard commented 1 year ago

hi @Aadarsh-Verma ,

this doesn't look like a bug so I'll close this.

gquintard commented 1 year ago

in short: