I am planning minor variations to HTML based on user-agent. Specifically, I would not be implementing ad codes (adsense and other third party ads) for certain user-agents (certain old browsers both on desktop and mobile). Other than the ad codes, the entire content will be the same for all user agents. For such minor variations, should I take any SEO precautions (for example, using HTTP vary header)?
-
1I'm not sure the vary header is needed for SEO, but it is needed for caching proxy servers and CDNs.– Stephen Ostermiller ♦Commented May 22, 2021 at 17:46
-
My doubt was due to the below lines found in developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary "It can help Google and other search engines to discover the mobile version of a page, and might also tell them that no Cloaking is intended."– KannanCommented May 23, 2021 at 2:56
-
Will minor changes like the one I have mentioned (removing ad codes from old browsers) amount to cloaking? If not, I may not have to worry...– KannanCommented May 23, 2021 at 2:57
1 Answer
Cloaking is only a problem if you treat search engine crawler user agents differently than normal users. Removing ads for a few normal users that have old browsers is not cloaking. You would still be treating Googlebot the same as the vast majority of human users.
Search engines might use the vary on the User-Agent
header if you were serving different mobile and desktop pages based on User-Agent
. I don't think that search engines are going to emulate crawling as an old browser and ever discover your variations. The Vary
header isn't going to be important or helpful for SEO in this case.
It is important to use the Vary: User-Agent
header for caching proxy servers and CDNs. Any system that caches your pages and returns them to multiple different users needs to know that every browser could get a different page.