9gag-open-source / mobiledetect-varnish
Varnish VCL device-detect based on Mobile_Detect
Installs: 57
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/9gag-open-source/mobiledetect-varnish
Requires
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 |