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
c287db36
Commit
c287db36
authored
Mar 06, 2012
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up, I believe all multiple objects per device class problems are sorted now
parent
3e6d6621
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
INSTALL.rst
INSTALL.rst
+14
-10
No files found.
INSTALL.rst
View file @
c287db36
...
...
@@ -73,16 +73,21 @@ Example 2: Normalize the User-Agent string
''''''''''''''''''''''''''''''''''''''''''
Another way of signaling the device type is to override or normalize the
User-Agent header sent to the backend
:
User-Agent header sent to the backend
.
User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; nb-no; HTC Desire Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 --> User-Agent: mobile-android
For example
This works if you don't need the original header for anything. A possible use
for this is for CGI scripts where only a small set of predefined headers are
(by default) available for the script.
User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; nb-no; HTC Desire Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
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.
becomes:
User-Agent: mobile-android
when seen by the backend.
This works if you don't need the original header for anything on the backend. A
possible use for this is for CGI scripts where only a small set of predefined
headers are (by default) available for the script.
.. 072-example2-start
VCL::
...
...
@@ -122,7 +127,6 @@ If everything else fails, you can add the device type as a GET argument.
The client itself does not see this classification, only the backend request is changed.
.. 073-example3-start
VCL::
...
...
@@ -163,7 +167,8 @@ VCL::
Different backend for mobile clients
------------------------------------
If you have a different backend that serves pages for mobile clients, or any special needs in VCL, you can use the X-UA-Device header like this::
If you have a different backend that serves pages for mobile clients, or any
special needs in VCL, you can use the X-UA-Device header like this::
include "devicedetect.vcl";
...
...
@@ -208,7 +213,6 @@ VCL::
.. 065-redir-mobile-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