Commit 6004a00a authored by Lasse Karstensen's avatar Lasse Karstensen

The entry regex is expensive, of unknown value, and complicates the examples....

The entry regex is expensive, of unknown value, and complicates the examples. We don't know what kind of content people will be serving with this, so this is better left as a local policy. (fixing merge problem)
parent 582cfccf
......@@ -9,10 +9,7 @@ To serve different content based on the device type, add the following VCL::
include "devicedetect.vcl";
sub vcl_recv {
# only do device detection on non-static content.
if (!req.url ~ "^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$") {
call devicedetect;
}
call devicedetect;
}
sub vcl_hash {
......@@ -36,10 +33,7 @@ If you have a different backend that serves pages for mobile clients, or any spe
}
sub vcl_recv {
# only do device detection on non-static content.
if (!req.url ~ "^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$") {
call devicedetect;
}
call devicedetect;
if (req.http.X-UA-Device ~ "^mobile" || req.http.X-UA-device ~ "^tablet") {
set req.backend = mobile;
......@@ -53,10 +47,7 @@ If you want to redirect mobile clients instead, you can use::
include "devicedetect.vcl";
sub vcl_recv {
# only do device detection on non-static content.
if (!req.url ~ "^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$") {
call devicedetect;
}
call devicedetect;
if (req.http.X-UA-Device ~ "^mobile" || req.http.X-UA-device ~ "^tablet") {
error 750 "Moved Temporarily";
......
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