Purge object transparently

spaceman spaceman at antispaceman.com
Wed Jul 16 18:27:35 CEST 2014


Thanks Andreas,

For anyone else interested as it wasn't that obvious:
sub vcl_purge {
    # restart request
    set req.http.X-Purge = "Yes";
    return(restart);
}
This X-Purge header is used to prevent purge from being called again because the
Cache-Control header is still set to no-cache on restart. If you fail to do that
you will get 503. I did it that way so the headers would be preserved for the
backend.

Regards,
spaceman

On 2014/07/16 11:07:00 , Andreas Plesner Jacobsen wrote:
> On Wed, Jul 16, 2014 at 10:17:32AM +0100, spaceman wrote:
> > 
> > return(purge) is useless as I don't want a page telling me my object has been
> > purged just the refreshed object. Obviously req.backend.healthy will be replaced
> > with std.healthy(req.backend_hint).
> > 
> > Any ideas?
> 
> You can restart in vcl_purge.
> 
> -- 
> Andreas
> 
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
> 
> 
> 
> 

!DSPAM:53c6a7f87581428214722!





More information about the varnish-misc mailing list