Mailing List Archive

r1187 - in branches/1.0: . man
Author: des
Date: 2006-10-18 16:27:20 +0200 (Wed, 18 Oct 2006)
New Revision: 1187

Modified:
branches/1.0/
branches/1.0/man/vcl.7
Log:
r32901 at cat (orig r1149): des | 2006-10-10 15:36:11 +0200
Add an example based on VG's PURGE code.



Property changes on: branches/1.0
___________________________________________________________________
Name: svk:merge
- d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1148
+ d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1149

Modified: branches/1.0/man/vcl.7
===================================================================
--- branches/1.0/man/vcl.7 2006-10-18 14:27:19 UTC (rev 1186)
+++ branches/1.0/man/vcl.7 2006-10-18 14:27:20 UTC (rev 1187)
@@ -34,8 +34,6 @@
.Sh NAME
.Nm VCL
.Nd Varnish Configuration Language
-.Sh SYNOPSIS
-.\" ...
.Sh DESCRIPTION
The
.Nm
@@ -278,6 +276,37 @@
}
}
.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