Mobile Device Detection with Varnish

Thanks to fangel who wrote this week an interesting blog on using Varnish to detect mobile devices, we are a step closer to creating performant architectures that serve both mobile and desktop websites.

The weak point of Mobile Tools is still that it cannot work in high performance scenarios where a caching layer like Varnish is put in front of your site. However, using the Varnish VLC syntax you can do some moderate user agent detection in order to get a feel of the device being used by the visiting user. Drupal can do the rest and switch the theme based on the visiting device (checkout hook_custom_theme).

The only shortcoming in the proposed method is that this does not allow easily to choose a theme based on device characteristics, such as screen size or browser version.... Something I tend to do very often.