Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
603e1cbd
Commit
603e1cbd
authored
Feb 18, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a currently unused vcl_backend_error{} method
parent
1e0e7b4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
28 deletions
+56
-28
builtin.vcl
bin/varnishd/builtin.vcl
+33
-21
generate.py
lib/libvcc/generate.py
+23
-7
No files found.
bin/varnishd/builtin.vcl
View file @
603e1cbd
...
...
@@ -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
);
}
...
...
lib/libvcc/generate.py
View file @
603e1cbd
...
...
@@ -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'
,)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment