Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-devicedetect
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-devicedetect
Commits
174afce3
Commit
174afce3
authored
Mar 06, 2012
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change markers
parent
1ea08b76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
INSTALL.rst
INSTALL.rst
+6
-2
No files found.
INSTALL.rst
View file @
174afce3
...
...
@@ -74,6 +74,7 @@ backend requests, and the backend mentions in the response Vary header that the
content is dependant on this header. Everything works out of the box from
Varnish's perspective.
... 071-example1-start
Example VCL::
include "devicedetect.vcl";
...
...
@@ -89,6 +90,7 @@ Example VCL::
# completed.
sub vcl_miss { call add_x-ua-device; }
sub vcl_pass { call add_x-ua-device; }
... 071-example1-end
Please remember that the backend must send a Vary header on User-Agent, or you will need to add that manually. See below for an example.
...
...
@@ -110,6 +112,7 @@ for this is for CGI scripts where only a small set of predefined headers are
To make sure that any caches out on the Internet doesn't cache it, a Vary header
on User-Agent must be added on the way out.
... 072-example2-start
VCL code::
# override the header before it is sent to the backend
...
...
@@ -123,6 +126,7 @@ VCL code::
else { set beresp.http.Vary = "User-Agent"; }
}
}
... 072-example2-end
Example 3: Add the device class as a GET query parameter
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
...
...
@@ -133,7 +137,7 @@ If everything else fails, you can add the device type as a GET argument.
The same Vary trickery from Example 2 must be added here also.
... example3-start
...
073-
example3-start
VCL::
# override the header before it is sent to the backend
...
...
@@ -167,7 +171,7 @@ VCL::
unset req.http.X-get-devicetype;
}
... example3-end
...
073-
example3-end
Testing tools
...
...
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