Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
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
varnishevent3
Commits
6e95c71c
Commit
6e95c71c
authored
Mar 01, 2011
by
Bjoern Ruberg
Committed by
Bjoern Ruberg
Mar 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typo patrol - again
parent
6b11aa28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
purging.rst
doc/sphinx/tutorial/purging.rst
+8
-9
No files found.
doc/sphinx/tutorial/purging.rst
View file @
6e95c71c
...
...
@@ -16,11 +16,11 @@ bans. First, let me explain the HTTP purges.
HTTP Purges
~~~~~~~~~~~
An HTTP purge is similar to a HTTP GET request, except that the
An HTTP purge is similar to a
n
HTTP GET request, except that the
*method* is PURGE. Actually you can call the method whatever you'd
like, but most people refer to this as purging. Squid supports the
same mechanism. In order to support purging in Varnish you need the
following VCL in place::
:
following VCL in place::
acl purge {
"localhost";
...
...
@@ -61,7 +61,7 @@ corresponding subroutine is called. In vcl_hit the object that is
stored in cache is available and we can set the TTL.
So for vg.no to invalidate their front page they would call out to
Varnish like this::
:
Varnish like this::
PURGE / HTTP/1.0
Host: vg.no
...
...
@@ -69,7 +69,7 @@ Varnish like this:::
And Varnish would then discard the front page. If there are several
variants of the same URL in the cache however, only the matching
variant will be purged. To purge a gzip variant of the same page the
request would have to look like this::
:
request would have to look like this::
PURGE / HTTP/1.0
Host: vg.no
...
...
@@ -85,7 +85,7 @@ have.
Support for bans is built into Varnish and available in the CLI
interface. For VG to ban every png object belonging on vg.no they could
issue::
:
issue::
purge req.http.host == "vg.no" && req.http.url ~ "\.png$"
...
...
@@ -96,7 +96,7 @@ deliver it. An object is only checked against newer bans. If you have
a lot of objects with long TTL in your cache you should be aware of a
potential performance impact of having many bans.
You can also add bans to Varnish via HTTP. Doing so requires a bit of VCL
.
::
You can also add bans to Varnish via HTTP. Doing so requires a bit of VCL::
sub vcl_recv {
if (req.request == "BAN") {
...
...
@@ -108,12 +108,11 @@ You can also add bans to Varnish via HTTP. Doing so requires a bit of VCL.::
"&& req.url == " req.url);
# Throw a synthetic page so the
# request wont go to the backend.
# request won
'
t go to the backend.
error 200 "Ban added"
}
}
This VCL sniplet enables Varnish to handle a
HTTP BAN method. A
dding a
This VCL sniplet enables Varnish to handle a
n HTTP BAN method, a
dding a
ban on the URL, including the host part.
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