]> err.no Git - varnish/commitdiff
Updated the man page for vcl to include the default bin/varnishd/default.vcl so it...
authorpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 6 Aug 2008 12:10:02 +0000 (12:10 +0000)
committerpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 6 Aug 2008 12:10:02 +0000 (12:10 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3065 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/etc/Makefile.am
varnish-cache/etc/default.vcl [deleted file]
varnish-cache/man/Makefile.am
varnish-cache/man/vcl.7so [moved from varnish-cache/man/vcl.7 with 93% similarity]

index daf6bea4d270c8fb3a0f453f3dafb4578cefa6b4..ee6f6d72be17c5b264b44e293e98582d1eb4d15e 100644 (file)
@@ -1,3 +1,24 @@
 # $Id$
 
-EXTRA_DIST = default.vcl zope-plone.vcl
+EXTRA_DIST = zope-plone.vcl
+
+dist_data_DATA = default.vcl
+
+default.vcl:
+       echo -e "This is a basic VCL configuration file for varnish.  See the vcl(7)\n\
+man page for details on VCL syntax and semantics.\n\
+\n\
+Default backend definition.  Set this to point to your content\n\
+server.\n\
+\n\
+backend default {\n\
+       .host = "127.0.0.1";\n\
+       .port = "8080";\n\
+}\n\
+\n\
+Below is a commented-out copy of the default VCL logic.  If you\n\
+redefine any of these subroutines, the built-in logic will be\n\
+appended to your code.\n" > tmp.vcl
+       sed -n '/vcl_recv/,$$p' ../bin/varnishd/default.vcl >> tmp.vcl
+       sed 's/^\(.*\)$$/#\1/' tmp.vcl > default.vcl
+       rm tmp.vcl
diff --git a/varnish-cache/etc/default.vcl b/varnish-cache/etc/default.vcl
deleted file mode 100644 (file)
index a61135f..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# This is a basic VCL configuration file for varnish.  See the vcl(7)
-# man page for details on VCL syntax and semantics.
-#
-# $Id$
-#
-
-# Default backend definition.  Set this to point to your content
-# server.
-
-backend default {
-       .host = "127.0.0.1";
-       .port = "8080";
-}
-
-# Below is a commented-out copy of the default VCL logic.  If you
-# redefine any of these subroutines, the built-in logic will be
-# appended to your code.
-
-## Called when a client request is received
-#
-#sub vcl_recv {
-#      if (req.request != "GET" &&
-#          req.request != "HEAD" &&
-#          req.request != "PUT" &&
-#          req.request != "POST" &&
-#          req.request != "TRACE" &&
-#          req.request != "OPTIONS" &&
-#          req.request != "DELETE") {
-#              pipe;
-#      }
-#      if (req.http.Expect) {
-#              pipe;
-#      }
-#      if (req.request != "GET" && req.request != "HEAD") {
-#              pass;
-#      }
-#      if (req.http.Authorization || req.http.Cookie) {
-#              pass;
-#      }
-#      lookup;
-#}
-#
-## Called when entering pipe mode
-#
-#sub vcl_pipe {
-#      pipe;
-#}
-#
-## Called when entering pass mode
-#
-#sub vcl_pass {
-#      pass;
-#}
-#
-## Called when entering an object into the cache
-#
-#sub vcl_hash {
-#      set req.hash += req.url;
-#      if (req.http.host) {
-#              set req.hash += req.http.host;
-#      } else {
-#              set req.hash += server.ip;
-#      }
-#      hash;
-#}
-#
-## Called when the requested object was found in the cache
-#
-#sub vcl_hit {
-#      if (!obj.cacheable) {
-#              pass;
-#      }
-#      deliver;
-#}
-#
-## Called when the requested object was not found in the cache
-#
-#sub vcl_miss {
-#      fetch;
-#}
-#
-## Called when the requested object has been retrieved from the
-## backend, or the request to the backend has failed
-#
-#sub vcl_fetch {
-#      if (!obj.valid) {
-#              error obj.status;
-#      }
-#      if (!obj.cacheable) {
-#              pass;
-#      }
-#      if (obj.http.Set-Cookie) {
-#              pass;
-#      }
-#       set obj.prefetch =  -30s;      insert;
-#}
-#
-## Called before a cached object is delivered to the client
-#
-#sub vcl_deliver {
-#      deliver;
-#}
-#
-## Called when an object nears its expiry time
-#
-#sub vcl_timeout {
-#      discard;
-#}
-#
-# Called when an object is about to be discarded
-#
-#sub vcl_discard {
-#      discard;
-#}
index ca8d53773ac0121b4369f7298def10d8f843a83d..e532b16fa3c9b4d21097d9b8576f6320b77d1586 100644 (file)
@@ -1,3 +1,8 @@
 # $Id$
 
 dist_man_MANS = vcl.7
+
+vcl.7: vcl.7so default.vcl
+       soelim $< > $@
+default.vcl:   ../bin/varnishd/default.vcl
+       sed -n '/vcl_recv/,$$w $@' $<
similarity index 93%
rename from varnish-cache/man/vcl.7
rename to varnish-cache/man/vcl.7so
index c9c1ef8d350a1abb86de18661db3ff71d6b47376..b34b3badd8b968e183739adcdb32a8eb529a0fad 100644 (file)
@@ -506,81 +506,7 @@ backend default {
     set backend.port = "http";
 }
 
-sub vcl_recv {
-    if (req.request != "GET" &&
-      req.request != "HEAD" &&
-      req.request != "PUT" &&
-      req.request != "POST" &&
-      req.request != "TRACE" &&
-      req.request != "OPTIONS" &&
-      req.request != "DELETE") {
-        pipe;
-    }
-    if (req.http.Expect) {
-        pipe;
-    }
-    if (req.request != "GET" && req.request != "HEAD") {
-        pass;
-    }
-    if (req.http.Authorization || req.http.Cookie) {
-        pass;
-    }
-    lookup;
-}
-
-sub vcl_pipe {
-    pipe;
-}
-
-sub vcl_pass {
-    pass;
-}
-
-sub vcl_hash {
-    set req.hash += req.url;
-    if (req.http.host) {
-        set req.hash += req.http.host;
-    } else {
-        set req.hash += server.ip;
-    }
-    hash;
-}
-
-sub vcl_hit {
-    if (!obj.cacheable) {
-        pass;
-    }
-    deliver;
-}
-
-sub vcl_miss {
-    fetch;
-}
-
-sub vcl_fetch {
-    if (!obj.valid) {
-        error obj.status;
-    }
-    if (!obj.cacheable) {
-        pass;
-    }
-    if (obj.http.Set-Cookie) {
-        pass;
-    }
-        set obj.prefetch =  -30s;    insert;
-}
-
-sub vcl_deliver {
-    deliver;
-}
-
-sub vcl_discard {
-    discard;
-}
-
-sub vcl_timeout {
-    discard;
-}
+.so default.vcl
 .Ed
 .Pp
 The following example shows how to support multiple sites running on