Commit dde15a6d authored by Petter Knudsen's avatar Petter Knudsen

Updated the default.vcl and man page with the latest config from mgt_vcc.c.

The following perl one-liner is useful:
perl -ne 'if( $print == 1 ) { exit if( /^$/ ); eval "print " . $_; } $print = 1 if /default_vcl/;' mgt_vcc.c 
Fixes #135 (for now)


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2994 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6001fdc2
...@@ -20,13 +20,22 @@ backend default { ...@@ -20,13 +20,22 @@ backend default {
## Called when a client request is received ## Called when a client request is received
# #
#sub vcl_recv { #sub vcl_recv {
# if (req.request != "GET" && req.request != "HEAD") { # if (req.request != "GET" &&
# req.request != "HEAD" &&
# req.request != "PUT" &&
# req.request != "POST" &&
# req.request != "TRACE" &&
# req.request != "OPTIONS" &&
# req.request != "DELETE") {
# pipe; # pipe;
# } # }
# if (req.http.Expect) { # if (req.http.Expect) {
# pipe; # pipe;
# } # }
# if (req.http.Authenticate || req.http.Cookie) { # if (req.request != "GET" && req.request != "HEAD") {
# pass;
# }
# if (req.http.Authorization || req.http.Cookie) {
# pass; # pass;
# } # }
# lookup; # lookup;
...@@ -48,7 +57,11 @@ backend default { ...@@ -48,7 +57,11 @@ backend default {
# #
#sub vcl_hash { #sub vcl_hash {
# set req.hash += req.url; # set req.hash += req.url;
# if (req.http.host) {
# set req.hash += req.http.host; # set req.hash += req.http.host;
# } else {
# set req.hash += server.ip;
# }
# hash; # hash;
#} #}
# #
...@@ -72,7 +85,7 @@ backend default { ...@@ -72,7 +85,7 @@ backend default {
# #
#sub vcl_fetch { #sub vcl_fetch {
# if (!obj.valid) { # if (!obj.valid) {
# error; # error obj.status;
# } # }
# if (!obj.cacheable) { # if (!obj.cacheable) {
# pass; # pass;
...@@ -80,10 +93,9 @@ backend default { ...@@ -80,10 +93,9 @@ backend default {
# if (obj.http.Set-Cookie) { # if (obj.http.Set-Cookie) {
# pass; # pass;
# } # }
# insert; # set obj.prefetch = -30s; insert;
#} #}
# #
#
## Called before a cached object is delivered to the client ## Called before a cached object is delivered to the client
# #
#sub vcl_deliver { #sub vcl_deliver {
...@@ -96,7 +108,7 @@ backend default { ...@@ -96,7 +108,7 @@ backend default {
# discard; # discard;
#} #}
# #
## Called when an object is about to be discarded # Called when an object is about to be discarded
# #
#sub vcl_discard { #sub vcl_discard {
# discard; # discard;
......
...@@ -507,13 +507,22 @@ backend default { ...@@ -507,13 +507,22 @@ backend default {
} }
sub vcl_recv { sub vcl_recv {
if (req.request != "GET" && req.request != "HEAD") { if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
pipe; pipe;
} }
if (req.http.Expect) { if (req.http.Expect) {
pipe; pipe;
} }
if (req.http.Authenticate || req.http.Cookie) { if (req.request != "GET" && req.request != "HEAD") {
pass;
}
if (req.http.Authorization || req.http.Cookie) {
pass; pass;
} }
lookup; lookup;
...@@ -529,7 +538,11 @@ sub vcl_pass { ...@@ -529,7 +538,11 @@ sub vcl_pass {
sub vcl_hash { sub vcl_hash {
set req.hash += req.url; set req.hash += req.url;
if (req.http.host) {
set req.hash += req.http.host; set req.hash += req.http.host;
} else {
set req.hash += server.ip;
}
hash; hash;
} }
...@@ -546,7 +559,7 @@ sub vcl_miss { ...@@ -546,7 +559,7 @@ sub vcl_miss {
sub vcl_fetch { sub vcl_fetch {
if (!obj.valid) { if (!obj.valid) {
error; error obj.status;
} }
if (!obj.cacheable) { if (!obj.cacheable) {
pass; pass;
...@@ -554,18 +567,18 @@ sub vcl_fetch { ...@@ -554,18 +567,18 @@ sub vcl_fetch {
if (obj.http.Set-Cookie) { if (obj.http.Set-Cookie) {
pass; pass;
} }
insert; set obj.prefetch = -30s; insert;
} }
sub vcl_deliver { sub vcl_deliver {
deliver; deliver;
} }
sub vcl_timeout { sub vcl_discard {
discard; discard;
} }
sub vcl_discard { sub vcl_timeout {
discard; discard;
} }
.Ed .Ed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment