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
c7e56c42
Commit
c7e56c42
authored
Sep 24, 2016
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Random polishing
parent
16b38907
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
24 deletions
+11
-24
v00020.vtc
bin/varnishtest/tests/v00020.vtc
+7
-20
vcl.rst
doc/sphinx/reference/vcl.rst
+4
-4
No files found.
bin/varnishtest/tests/v00020.vtc
View file @
c7e56c42
...
...
@@ -22,18 +22,6 @@ varnish v1 -errvcl {Found: '0' at} { 0; }
varnish v1 -errvcl {Expected an action, 'if', } " sub vcl_recv { { } { "
varnish v1 -vcl {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response {
set beresp.ttl = 1w;
set beresp.ttl *= 1.5;
set beresp.ttl = 1.5 s * 2.5;
set beresp.ttl = 1.5 s / 2.5;
set beresp.ttl = 1.5h + 1.5s;
set beresp.ttl = 1.5h - 1.5s;
}
}
varnish v1 -errvcl {Comparison of different types: INT '!=' STRING} {
sub vcl_recv {
if (!req.restarts != req.url) {
...
...
@@ -109,10 +97,17 @@ varnish v1 -vcl {
set req.http.foo = req.http.foo + "bar" !~ "bar";
set req.ttl = 1s;
set req.ttl *= 1.5;
set req.ttl = 1.5 s * 2.5;
set req.ttl = 1.5 s / 2.5;
set req.ttl = 1.5h + 1.5s;
set req.ttl = 1.5h - 1.5s;
if (req.ttl) { }
if (!req.ttl) { }
if (!req.url) { }
if (1) { }
}
}
...
...
@@ -231,14 +226,6 @@ varnish v1 -errvcl {DURATION + STRING not possible.} {
}
}
varnish v1 -vcl {
backend b { .host = "127.0.0.1"; }
sub vcl_miss {
if (!req.url) {
}
}
}
varnish v1 -errvcl {Name of function, 'foo-bar', contains illegal character '-'} {
backend b { .host = "127.0.0.1"; }
sub foo-bar {
...
...
doc/sphinx/reference/vcl.rst
View file @
c7e56c42
...
...
@@ -100,8 +100,8 @@ Time
~~~~
VCL has time. A duration can be added to a time to make another time.
In string context they return a formatted string in RFC1123 format
(e.g. Sun, 06 Nov 1994 08:49:37 GMT)
.
In string context they return a formatted string in RFC1123 format
,
e.g. Sun, 06 Nov 1994 08:49:37 GMT
.
The keyword *now* returns a time representing the current time in seconds
since the Epoch.
...
...
@@ -109,8 +109,8 @@ since the Epoch.
Durations
~~~~~~~~~
Durations are defined by a number
and a designation. The number can be a real
so 1.5w is allowed.
Durations are defined by a number
followed by an unit. The number can
include a fractional part, e.g. 1.5s. The supported units are:
ms
milliseconds
...
...
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