1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
|
.\" Man page generated from reStructuredText.
.
.TH VMOD_PURGE 3 "" "" ""
.SH NAME
vmod_purge \- Varnish Purge Module
.
.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_purge.vcc and run make instead
.
.\"
.
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
import purge [as name] [from "path"]
INT hard()
INT soft(DURATION ttl, DURATION grace, DURATION keep)
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
\fIvmod_purge\fP contains functions that offer a finer\-grained control
than \fBreturn(purge)\fP from \fBvcl_recv{}\fP\&. The functions can only be
called from \fBvcl_hit{}\fP or \fBvcl_miss{}\fP and they should in general
be used in both to ensure that all variants of a same object are taken
care of.
.SH EXAMPLE
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
sub vcl_recv {
if (req.method == "PURGE") {
if (client.ip !~ purge_acl) {
return (synth(405));
}
return (hash);
}
}
sub my_purge {
set req.http.purged = purge.hard();
if (req.http.purged == "0") {
return (synth(404));
}
else {
return (synth(200));
}
}
sub vcl_hit {
if (req.method == "PURGE") {
call my_purge;
}
}
sub vcl_miss {
if (req.method == "PURGE") {
call my_purge;
}
}
sub vcl_synth {
if (req.method == "PURGE") {
if (req.http.purged) {
set resp.http.purged = req.http.purged;
}
return (deliver);
}
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS INT hard()
.sp
This is equivalent to \fBreturn(purge)\fP but explicitly called from
\fBvcl_hit{}\fP and \fBvcl_miss{}\fP\&. It returns the number of purged
objects.
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set req.http.purged = purge.hard();
.ft P
.fi
.UNINDENT
.UNINDENT
.SS INT soft(DURATION ttl, DURATION grace, DURATION keep)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INT soft(DURATION ttl=0, DURATION grace=\-1, DURATION keep=\-1)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Sets the \fIttl\fP, \fIgrace\fP and \fIkeep\fP\&.
.sp
By default, \fIttl\fP is set to 0 with \fIgrace\fP and \fIkeep\fP periods left
untouched. Setting a negative value for \fIgrace\fP or \fIkeep\fP periods
leaves them untouched. Setting all three parameters to \fB0\fP is
equivalent to a hard purge. It can only be called from \fBvcl_hit{}\fP
or \fBvcl_miss{}\fP\&. It returns the number of soft\-purged objects.
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fIvcl(7)\fP
.UNINDENT
.SH COPYRIGHT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Copyright (c) 2017 Varnish Software AS
All rights reserved.
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
SPDX\-License\-Identifier: BSD\-2\-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS \(ga\(gaAS IS\(aq\(aq AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
.ft P
.fi
.UNINDENT
.UNINDENT
.\" Generated by docutils manpage writer.
.
|