Hello,

How can I serve an old object during the fetch of an expired object or max
out connection?

I¹ve configured the grace period in both the vcl_recv as the vcl_fetch.

I even tried to use the saint mode to give me back an ³old² cached object.

Can somebody give me help in this matter?

sub vcl_recv {

    # Purge through http
    if (req.request == "PURGE") {
        if (!client.ip ~ purge) {
            error 405 "Not allowed.";
        }
        ban("req.url ~ " + req.url );
        error 200 "Purged.";
    }

    # Unset all cookies available
    if (req.http.cookie) {
        unset req.http.cookie;
    }

     if (req.request != "GET" && req.request != "HEAD") {
        /* We only deal with GET and HEAD by default */
        return (pass);
    }

    # Adding Grace period in case backend lags
    set req.grace = 3d;
    return (lookup);
}
....
sub vcl_fetch {
    set beresp.grace = 4d;
    set beresp.saintmode = 50s;
    set beresp.ttl = 30s;
    return (deliver);
}


_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to