Is there a recommended method for using varnish with mobile_tools? I would be very interested in this, and don't mind looking into developing a plugin module if required. On one of our current sites, we have varnish letting mobile devices through (with a header to confirm varnish has okayed it to prevent accidental caching of the mobile site to desktop users). The custom module then checks this header, and sets a relevant cookie for the device, on future page loads, this cookie is then used to cache variant version of the site.
This cookie can also be set to 'desktop' by clicking a link within the site, allowing a mobile user to choose to view a desktop version of the website. The module does a few other bits, but these are the main pieces of functionality we would require.
I was hoping to get peoples thoughts on this, and whether there is already a working method for this?
Thanks,
Dan
Comments
Comment #1
rasmusluckow commentedSubscribing.
Comment #2
vinmassaro commentedAlso interested about using mobile_tools from behind a reverse proxy.
Comment #3
cayenne commentedsubscribing too!
Comment #4
seakayjay commentedInterested. Subscribe!
Comment #5
dabblela commentedBump with an interesting article here:
http://fangel.github.com/mobile-detection-varnish-drupal/
I haven't looked into mt much (yet) but I wonder if some combination of the above method and an implementation of hook_is_mobile_device() might be enough?
Comment #6
askibinski commented@manatwo
thanks for that article it helped a lot!
And you are right, using the VCL code in that article and a little code in your own module, detection works.
Based on that code you can use hook_is_mobile_device together with hook_device_groups to do something like this:
Now, just as stated in the article, the detection is pretty basic but you could expand on that by extending the VCL file.
Comment #7
udvranto commentedSubscribing