-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
For example, this is Amazon CloudFront.
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device
CloudFront don't send User-Agent to backend. But It can send the custom headers instead of User-Agent.
- CloudFront-Is-Desktop-Viewer
- CloudFront-Is-Mobile-Viewer
- CloudFront-Is-SmartTV-Viewer
- CloudFront-Is-Tablet-Viewer
Now, I add like this code.
if ( ! $this->device ) {
if ($_SERVER['HTTP_CLOUDFRONT_IS_DESKTOP_VIEWER') == "true" ) { /* do nothing */ }
elseif ($_SERVER['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER') == "true" ) { $this->device = "smart"; }
elseif ($_SERVER['HTTP_CLOUDFRONT_IS_TABLET_VIEWER') == "true" ) { $this->device = "tablet"; }
elseif ($_SERVER['HTTP_CLOUDFRONT_IS_SMARTTV_VIEWER') == "true" ) { $this->device = "game"; /* ??? */ }
}Really, I want to configure the list of set of header name and matching value on /wp-admin/, but it is very hard for me.
Metadata
Metadata
Assignees
Labels
No labels