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
ef88646a
Commit
ef88646a
authored
Jun 06, 2013
by
Per Buer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add intro
parent
7cfa03ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
vary.rst
doc/sphinx/users-guide/vary.rst
+16
-10
No files found.
doc/sphinx/users-guide/vary.rst
View file @
ef88646a
...
...
@@ -6,16 +6,22 @@ HTTP Vary
*HTTP Vary is not a trivial concept. It is by far the most
misunderstood HTTP header.*
The Vary header is sent by the web server to indicate what makes a
HTTP object Vary. This makes a lot of sense with headers like
Accept-Language. When a backend server issues a "Vary:
Accept-Language" it tells Varnish that its needs to cache a separate
version for every different Accept-Language that is coming from the
clients.
If two clients say they accept the languages "en-us, en-uk" and "da, de"
respectively, Varnish will cache and serve two different versions of
the page.
A lot of the response headers tell the client something about the HTTP
object being delivered. Clients can request different variants a an
HTTP object, based on their preference. Their preferences might cover
stuff like encoding or language. When a client prefers UK English this
is indicated through "Accept-Language: en-uk". Caches need to keep
these different variants apart and this is done through the HTTP
response header "Vary".
When a backend server issues a "Vary: Accept-Language" it tells
Varnish that its needs to cache a separate version for every different
Accept-Language that is coming from the clients.
If two clients say they accept the languages "en-us, en-uk" and "da,
de" respectively, Varnish will cache and serve two different versions
of the page if the backend indicated that Varnish needs to vary on the
Accept-Language header.
Please note that the headers that Vary refer to need to match
*exactly* for there to be a match. So Varnish will keep two copies of
...
...
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