Skip to content

CDN ​

CloudFront ​

When the User-Agent matches Amazon CloudFront case-insensitively, the following headers are checked:

  • CloudFront-Is-Android-Viewer
  • CloudFront-Is-Desktop-Viewer
  • CloudFront-Is-IOS-Viewer
  • CloudFront-Is-Mobile-Viewer
  • CloudFront-Is-Tablet-Viewer

Pass request headers via headers. If no device type header is true, the result includes isUnknown: true.

CAUTION

CloudFront does not provide headers for detecting Windows or macOS.

Configure device type headers in CloudFront.

Cloudflare ​

If the CloudFront rule does not apply and CF-Device-Type is mobile, tablet, or desktop, that value takes precedence over the User-Agent for device type detection. If the header is missing or its value is unrecognized, detection falls back to the User-Agent.

Configure Cache by device type in Cloudflare APO.

Released under the MIT License.