Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
faf767b2
Commit
faf767b2
authored
Feb 17, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.varnish-cache.org/git/varnish-cache
parents
90ff618f
b6ec427f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
20 deletions
+26
-20
varnishd.rst
doc/sphinx/reference/varnishd.rst
+19
-13
vcl.rst
doc/sphinx/reference/vcl.rst
+6
-6
increasing_your_hitrate.rst
doc/sphinx/tutorial/increasing_your_hitrate.rst
+1
-1
No files found.
doc/sphinx/reference/varnishd.rst
View file @
faf767b2
...
...
@@ -839,30 +839,36 @@ waiter
Purge expressions
-----------------
A purge expression consists of one or more conditions. A condition consists of a field, an operator, and an
argument. Conditions can be ANDed together with "&&".
A purge expression consists of one or more conditions. A condition
consists of a field, an operator, and an argument. Conditions can be
ANDed together with "&&".
A field can be any of the variables from VCL, for instance req.url, req.http.host or obj.set-cookie.
A field can be any of the variables from VCL, for instance req.url,
req.http.host or obj.set-cookie.
Operators are "==" for direct comparision, "~" for a regular expression match, and ">" or "<" for size compar‐
isons. Prepending an operator with "!" negates the expression.
Operators are "==" for direct comparision, "~" for a regular
expression match, and ">" or "<" for size comparisons. Prepending
an operator with "!" negates the expression.
The argument could be a quoted string, a regexp, or an integer. Integers can have "KB", "MB", "GB" or "TB"
appended for size related fields.
The argument could be a quoted string, a regexp, or an integer.
Integers can have "KB", "MB", "GB" or "TB" appended for size related
fields.
Simple example: All requests where req.url exactly matches the string /news are purged from the cache:::
Simple example: All requests where req.url exactly matches the string
/news are purged from the cache:::
req.url == "/news"
Example: Purge all documents where the name does not end with ".ogg",
and where the size of the object is greater
than 10 megabytes:::
Example: Purge all documents where the name does not end with ".ogg",
and where the size of the object is greater
than 10 megabytes:::
req.url !~ "\.ogg$" && obj.size > 10MB
Example: Purge all documents where the serving host is "example.com" or "www.example.com", and where the Set-
Cookie header received from the backend contains "USERID=1663":::
Example: Purge all documents where the serving host is "example.com"
or "www.example.com", and where the Set- Cookie header received from
the backend contains "USERID=1663":::
req.http.host ~ "^(www\.)example.com$" && obj.set-cookie ~ "USERID=1663"
req.http.host ~ "^(
?i)(
www\.)example.com$" && obj.set-cookie ~ "USERID=1663"
SEE ALSO
========
...
...
doc/sphinx/reference/vcl.rst
View file @
faf767b2
...
...
@@ -92,7 +92,7 @@ A backend declaration creates and initializes a named backend object:::
The backend object can later be used to select a backend at request time:::
if (req.http.host ~ "^(www.)?example.com$") {
if (req.http.host ~ "
(?i)
^(www.)?example.com$") {
set req.backend = www;
}
...
...
@@ -528,9 +528,9 @@ Example:::
# in file "backends.vcl"
sub vcl_recv {
if (req.http.host ~ "example.com") {
if (req.http.host ~ "
(?i)
example.com") {
set req.backend = foo;
} elsif (req.http.host ~ "example.org") {
} elsif (req.http.host ~ "
(?i)
example.org") {
set req.backend = bar;
}
}
...
...
@@ -731,7 +731,7 @@ Values may be assigned to variables using the set keyword:::
sub vcl_recv {
# Normalize the Host: header
if (req.http.host ~ "^(www.)?example.com$") {
if (req.http.host ~ "
(?i)
^(www.)?example.com$") {
set req.http.host = "www.example.com";
}
}
...
...
@@ -803,10 +803,10 @@ based on the request URL:::
}
sub vcl_recv {
if (req.http.host ~ "^(www.)?example.com$") {
if (req.http.host ~ "
(?i)
^(www.)?example.com$") {
set req.http.host = "www.example.com";
set req.backend = www;
} elsif (req.http.host ~ "^images.example.com$") {
} elsif (req.http.host ~ "
(?i)
^images.example.com$") {
set req.backend = images;
} else {
error 404 "Unknown virtual host";
...
...
doc/sphinx/tutorial/increasing_your_hitrate.rst
View file @
faf767b2
...
...
@@ -177,7 +177,7 @@ Varnish will cache different versions of every page for every
hostname. You can mitigate this in your web server configuration by
setting up redirects or by using the following VCL::
if (req.http.host ~ "^(www.)?varnish-?software.com") {
if (req.http.host ~ "
(?i)
^(www.)?varnish-?software.com") {
set req.http.host = "varnish-software.com";
}
...
...
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