varnish serve old object during refresh

AD straightflush at gmail.com
Tue Feb 7 14:27:17 CET 2012


The VCL looks right at first glance.  Are you sure the object is actually
being cached in the first place?  You can confirm with something like this
in your vcl_deliver

if (obj.hits > 0) {
     set resp.http.X-Cache = "HIT";
     } else {
     set resp.http.X-Cache = "MISS";
  }

On Tue, Feb 7, 2012 at 2:48 AM, Jaap van Arragon
<j.vanarragon at lukkien.com>wrote:

>  Hello,
>
> Sorry for “kicking” my question but I really need help with this.
>
> How can I configure varnish 3 so that it will serve cached objects to the
> client while the new objects are being fetched from the backed?
>
> Hope to hear something.
>
> Thank you.
>
> Regards,
> Jaap van Arragon
>
>
>
> On 1/30/12 3:23 PM, "Jaap van Arragon" <j.vanarragon at lukkien.com> wrote:
>
> 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
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>
> _______________________________________________
> 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/20120207/958b99ce/attachment.html>


More information about the varnish-misc mailing list