.\" Man page generated from reStructuredText. . .TH VMOD_SOFTPURGE Soft "" "" "" .SH NAME vmod_softpurge \- purge vmod . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" . .\" NB: This file is machine generated, DO NOT EDIT! . .\" . .\" Edit vmod.vcc and run make instead . .\" . .SH SYNOPSIS .sp import softpurge [from "path"] ; .SH DESCRIPTION .sp \fBSoftpurge\fP is cache invalidation in Varnish that reduces TTL but keeps the grace value of a resource. .sp This makes it possible to serve stale content to users if the backend is unavailable and fresh content can not be fetched. .\" vcl-start . .sp Example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C vcl 4.0; import softpurge; backend default { .host = "192.0.2.11"; .port = "8080"; } sub vcl_recv { # Return early to avoid return(pass) by builtin VCL. if (req.method == "PURGE") { return (hash); } } sub vcl_backend_response { # Set object grace so we keep them around after TTL has expired. set beresp.grace = 10m; } sub vcl_hit { if (req.method == "PURGE") { softpurge.softpurge(); return (synth(200, "Successful softpurge")); } } sub vcl_miss { if (req.method == "PURGE") { softpurge.softpurge(); return (synth(200, "Successful softpurge")); } } .ft P .fi .UNINDENT .UNINDENT .\" vcl-end . .SH CONTENTS .INDENT 0.0 .IP \(bu 2 VOID softpurge() .UNINDENT .SS softpurge .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C VOID softpurge() .ft P .fi .UNINDENT .UNINDENT .sp Performs a soft purge. Valid in vcl_hit and vcl_miss. .sp Example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C sub vcl_hit { if (req.method == "PURGE") { softpurge.softpurge(); } } .ft P .fi .UNINDENT .UNINDENT .\" Generated by docutils manpage writer. .