Commit 174afce3 authored by Lasse Karstensen's avatar Lasse Karstensen

change markers

parent 1ea08b76
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment