Search:  

Previous pageMobile Sites Next page
Using the Vary User-Agent header 

If you using a device-aware approach, based on the User-Agent, you should set the HTTP Very header to indicate that the content of the page varies depending on the value of the User Agent string. There are two reasons for doing this:

1. Intermediate proxy caches use this value to decide whether to cache a page. If you don't tell it that your pages vary depending on the User Agent value, then they could store the content from one device, and deliver it in response to a request from an inappropriate device. With the Vary header set, the proxy knows to keep a separate cache of the page for each different User Agent string.

2. Google's search engine crawls pages pretending to be a desktop, and a mobile device. If you use the Vary header you can tell them your mobile pages are optimised for mobile devices, and they will crawl for them specifically, and give you a better ranking as your mobile pages will be seen as accessible for mobile devices.

Learn more from Google: Mobile SEO / Signal your configuration to search engines / Dynamic serving

Method

The BE / Settings / General Option / "HTTP 'Vary: User-Agent'"

This is set, by default, to "Automatic". Alternative values are "Yes" and "No"

These values control whether the HTTP Vary header is set to "User-Agent" or not:

  • Yes - the value is set to User-Agent
  • No - the value is not set to User-Agent
  • Automatic - the value is set to User-Agent if any of the User Groups have an Automatic Membership set based on the User Agent string.

If your site is using User-Agents for your User Groups, and you are providing alternate pages for desktop and mobile devices, then the default Automatic value is correct, and you do not need to do anything to benefit from this.

If your site is using User-Agents, but some of your pages are not provided as alternates, you may want to set the setting to No for those shared pages.

Note:

If you are using one of the following operating systems on your server, there is a bug in IIS that prevents the Vary header value from being set correctly (the "User-Agent" value is overwritten by "Accept-Encoding").

  • Windows 8.1
  • Windows Server 2012 R2
  • Windows 8
  • Windows Server 2012
  • Windows 7 SP1
  • Windows Server 2008 R2 SP1

Microsoft have released a Hotfix for this, which is available from this link:
https://support.microsoft.com/en-us/kb/2877816

Mobile Sites 
Copyright © 2023 Enstar LLC    All rights reserved Print this pageTranslate: