varnish 3.0 + mobile app

Javier Casares javier at casares.org
Fri Mar 7 00:26:20 CET 2014


Try

sub identify_device {
  if (req.http.User-Agent ~ "mobileapp" ) {
    set req.http.X-UA-Device = "mobileapp";
  } else {
    set req.http.X-UA-Device = "pc";
  }
}

And

sub vcl_hash {
  if (req.http.X-UA-Device) {
    hash_data(req.http.X-UA-Device);
  }
}



More information about the varnish-misc mailing list