I'm currently running Magento 1.7 with Varnish Turpentine.
I have noticed a strange behavior on cached content - Varnish returns same content for mobile and tablet(iPad), although in Magento back-end I have set design exceptions for matched expressions (iPad should use default, mobiles use mobi) and it works like a charm until varnish default.vcl is applied.
After checking around I found out that varnish use device detection and normalizes user-agent as per following:
if (req.http.User-Agent ~ "iP(?:hone|ad|od)|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera (?:Mini|Mobi)") {
set req.http.X-Normalized-User-Agent = "mobile";
Well, fair enough... clearly mobiles and tablets will return same cache hit as both are normalized as mobile ... lets separate iPad I though
if (req.http.User-Agent ~ "iP(?:hone|od)|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera (?:Mini|Mobi)") {
set req.http.X-Normalized-User-Agent = "mobile";
else if (req.http.User-Agent ~ "iPad") {
set req.http.X-Normalized-User-Agent = "ipad";
A big surprise after this change was that varnish still returns same cached content.
I have tried to use different varnish device-detects but all unfortunately failed.
Have anybody has a smallest clue what could be the issue?