git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1149
d4fa192b-c00b-0410-8231-
f00ffab90ce4
.Sh NAME
.Nm VCL
.Nd Varnish Configuration Language
-.Sh SYNOPSIS
-.\" ...
.Sh DESCRIPTION
The
.Nm
}
}
.Ed
+.Pp
+The following code implements the HTTP PURGE method as used by Squid
+for object invalidation:
+.Bd -literal -offset 4n
+acl purge {
+ "localhost";
+ "10.0.0.1"/8;
+}
+
+sub vcl_recv {
+ if (req.request == "PURGE") {
+ if (!client.ip ~ purge) {
+ error 405 "Not allowed.";
+ }
+ lookup;
+ }
+}
+
+sub vcl_hit {
+ if (req.request == "PURGE") {
+ set obj.ttl = 0s;
+ error 200 "Purged.";
+ }
+}
+
+sub vcl_miss {
+ if (req.request == "PURGE") {
+ error 404 "Not in cache.";
+ }
+}
+.Ed
.Sh SEE ALSO
.Xr varnishd 1
.Sh HISTORY