Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Does AWS CloudFront Detect Mobile Devices

AWS CloudFront can detect the device type based on the value of the User-Agent header:

If you want CloudFront to cache different versions of your objects based on the device a user is using to view your content, configure CloudFront to forward the applicable headers to your custom origin:

  • CloudFront-Is-Desktop-Viewer
  • CloudFront-Is-Mobile-Viewer
  • CloudFront-Is-SmartTV-Viewer
  • CloudFront-Is-Tablet-Viewer

Based on the value of the User-Agent header, CloudFront sets the value of these headers to true or false before forwarding the request to your origin. If a device falls into more than one category, more than one value might be true. For example, for some tablet devices, CloudFront might set both CloudFront-Is-Mobile-Viewer and CloudFront-Is-Tablet-Viewer to true.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device

I'm wondering if AWS has published a list of user agents they use to detect mobile browsers.

The documentation mentioned "If a device falls into more than one category", so I need to know how it determines these categories.

like image 660
Nic Avatar asked May 15 '18 05:05

Nic


People also ask

How CloudFront delivers content to your users?

CloudFront delivers your content through a worldwide network of data centers called edge locations. When a user requests content that you're serving with CloudFront, the request is routed to the edge location that provides the lowest latency (time delay), so that content is delivered with the best possible performance.

How does CloudFront routing work?

DNS routes the request to the CloudFront POP (edge location) that can best serve the request—typically the nearest CloudFront POP in terms of latency—and routes the request to that edge location. CloudFront checks its cache for the requested object. If the object is in the cache, CloudFront returns it to the user.

How does Amazon CloudFront accelerate content?

CloudFront speeds up content delivery by leveraging its global network of data centers, known as edge locations, to reduce delivery time by caching your content close to your end users.


1 Answers

AWS uses detects the device base on the user agent, but doesn't provide any details.

A list of user agents can be found here.

like image 174
Nic Avatar answered Nov 07 '22 21:11

Nic