9gag-open-source/mobiledetect-varnish

This package is abandoned and no longer maintained. No replacement package was suggested.

Varnish VCL device-detect based on Mobile_Detect

0.2.0 2017-09-28 05:45 UTC

This package is not auto-updated.

Last update: 2020-12-21 04:53:39 UTC


README

A tool to generate VCL function for Varnish using rules from Mobile_Detect.

Based on varnish-mobiletranslate.

Intended to be a drop-in replacement for devicedetect.

Installation

composer install 9gag-open-source/mobiledetect-varnish

Generating Varnish VCL

$generator = new \Detection\MobileDetect\Varnish\DeviceDetect();
echo $generator->generateVcl();

Using the VCL

Include the generated code in your Varnish VCL. The devicedetect function adds a X-UA-Device header to the request.

Device Type X-UA-Device
Phone mobile
Tablet tablet
Crawler bots bot
Other desktop