Commit 603e1cbd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a currently unused vcl_backend_error{} method

parent 1e0e7b4c
......@@ -41,6 +41,9 @@
vcl 4.0;
#######################################################################
# Client side
sub vcl_recv {
if (req.restarts == 0) {
if (req.http.x-forwarded-for) {
......@@ -117,27 +120,6 @@ sub vcl_miss {
return (fetch);
}
sub vcl_backend_fetch {
return (fetch);
}
sub vcl_backend_response {
if (beresp.ttl <= 0s ||
beresp.http.Set-Cookie ||
beresp.http.Surrogate-control ~ "no-store" ||
(!beresp.http.Surrogate-Control &&
beresp.http.Cache-Control ~ "no-cache|no-store|private") ||
beresp.http.Vary == "*") {
/*
* Mark as "Hit-For-Pass" for the next 2 minutes
*/
set beresp.ttl = 120s;
set beresp.uncacheable = true;
}
return (deliver);
}
sub vcl_deliver {
/*
* These two write to the stored object causing extra page faults
......@@ -176,6 +158,36 @@ sub vcl_error {
return (deliver);
}
#######################################################################
# Backend Fetch
sub vcl_backend_fetch {
return (fetch);
}
sub vcl_backend_response {
if (beresp.ttl <= 0s ||
beresp.http.Set-Cookie ||
beresp.http.Surrogate-control ~ "no-store" ||
(!beresp.http.Surrogate-Control &&
beresp.http.Cache-Control ~ "no-cache|no-store|private") ||
beresp.http.Vary == "*") {
/*
* Mark as "Hit-For-Pass" for the next 2 minutes
*/
set beresp.ttl = 120s;
set beresp.uncacheable = true;
}
return (deliver);
}
sub vcl_backend_error {
return (deliver);
}
#######################################################################
# Housekeeping
sub vcl_init {
return (ok);
}
......
......@@ -78,6 +78,10 @@ tokens = {
# Our methods and actions
returns =(
###############################################################
# Client side
('recv',
"C",
('error', 'pass', 'pipe', 'hash', 'purge',)
......@@ -106,6 +110,18 @@ returns =(
"C",
('error', 'restart', 'pass', 'fetch', 'deliver',)
),
('deliver',
"C",
('restart', 'deliver',)
),
('error',
"C",
('restart', 'deliver',)
),
###############################################################
# Backend-fetch
('backend_fetch',
"B",
('fetch', 'abandon')
......@@ -114,14 +130,14 @@ returns =(
"B",
('deliver', 'retry', 'abandon')
),
('deliver',
"C",
('restart', 'deliver',)
),
('error',
"C",
('restart', 'deliver',)
('backend_error',
"B",
('deliver', 'retry')
),
###############################################################
# Housekeeping
('init',
"",
('ok',)
......
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