Varnish that Site

Varnish Cache logoSo you want to serve smartphone-optimized HTML pages to your mobile users – and you want them served fast?

Simply install Varnish and let it do device-type detection and caching for you! Just follow these few steps:

1. Install Varnish from

2. Add to your default.vcl file

3. Add the code below to the beginning of the vcl_recv function:

4. Finally, add this code to the beginning of the vcl_hash function:

Now you can use the “X-UA-Device” request header in your app server to automatically detect desktops, tablets, and mobile phones and build HTML code optimized for each device type!

1 thought on “Varnish that Site

Comments are closed.