What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 5 questions

Less than a minute. Find out how much you really know about Google search.

🕒 ~1 min 🎯 5 questions

Official statement

For adaptive web pages serving different content based on the user agent, it is crucial to use the HTTP header 'Vary: User-Agent' only where the content genuinely differs.
15:03
🎥 Source video

Extracted from a Google Search Central video

⏱ 43:34 💬 EN 📅 28/05/2015 ✂ 9 statements
Watch on YouTube (15:03) →
Other statements from this video 8
  1. 4:10 Pourquoi Google a-t-il rebaptisé Webmaster Tools en Search Console ?
  2. 7:17 Les liens raccourcis goo.gl peuvent-ils vraiment booster votre stratégie de deep linking mobile ?
  3. 11:56 Le mobile-friendly reste-t-il un facteur de ranking déterminant pour votre site ?
  4. 14:10 La vitesse mobile échappe-t-elle vraiment aux critères de ranking mobile-friendly ?
  5. 16:33 PageSpeed Insights vs test mobile-friendly : pourquoi Google utilise-t-il deux outils différents ?
  6. 21:01 Faut-il vraiment un sitemap mobile séparé quand on a des URLs distinctes ?
  7. 23:42 Comment les listes locales influencent-elles vraiment vos positions dans les SERP ?
  8. 30:03 Google punit-il vraiment les réseaux de liens en silence ?
📅
Official statement from (11 years ago)
TL;DR

Google states that the HTTP header 'Vary: User-Agent' should only be applied on pages where the content truly differs based on the device. Applying this header indiscriminately across all pages can harm caching and slow down indexing. The recommendation is clear: segment your adaptive pages and only apply the header where HTML significantly varies between desktop and mobile.

What you need to understand

Why does Google emphasize the precise use of the 'Vary: User-Agent' header?

The HTTP header 'Vary: User-Agent' lets browsers and caching proxies know that a page may deliver different content depending on the requesting user agent. When this header is present, caching servers understand they need to store multiple versions of the same URL.

The problem? If you apply this header to all your pages when only a part of your content truly varies, you are unnecessarily fragmenting the cache. Googlebot then crawls multiple identical versions, which slows down exploration and dilutes your crawl budget.

What defines an adaptive web page in this context?

An adaptive page (adaptive responsive design) serves different HTML depending on the device, unlike pure responsive design that only adapts CSS. For instance, your desktop page displays a carousel with 10 images, while the mobile version loads only 3 to reduce the load.

In this specific case, the content genuinely varies, and the 'Vary: User-Agent' header is justified. However, if your page serves exactly the same HTML with only a few CSS adjustments, this header becomes counterproductive.

How can you identify pages that actually need this header?

Inspect your HTML source by comparing desktop and mobile. If the structural tags, textual content, images, or scripts differ, then yes, the header is relevant. A simple layout change via CSS does not count.

Also, monitor your server logs and response times. A fragmented cache leads to low hit rates and higher loading times for your mobile users. This is often the first signal that you are applying the header too broadly.

  • Only apply 'Vary: User-Agent' on pages serving different HTML based on the device
  • Avoid using this header globally across all URLs of your site
  • Regularly check your cache logs to detect excessive fragmentation
  • Clearly distinguish between responsive CSS (no Vary) and adaptive HTML content (Vary required)
  • Document affected pages in your technical SEO strategy

SEO Expert opinion

Is this recommendation consistent with field observations?

Absolutely. I have audited dozens of sites that applied 'Vary: User-Agent' in a cargo cult manner, without understanding the real impact. The result: CDN cache rates dropping below 40%, Googlebot crawl times doubling, and degraded Core Web Vitals.

What’s surprising is how clearly Google states it. Usually, they are vague about HTTP headers. Here, the message is clear: stop using this header everywhere. It's a signal that many sites make this mistake and that it impacts their crawl infrastructure.

What nuances should be considered with this statement?

Google does not specify how to handle hybrid cases, those pages serving 95% of the same content but with minor variations. For example, a page that hides a promotional banner on mobile using server-side rendering. Technically, the HTML differs. Should the cache really be fragmented for that? [To be checked]

Another gray area includes sites using modern JavaScript frameworks with conditional server-side rendering. Next.js, Nuxt, Astro... all can generate different outputs based on the agent. Does Google's recommendation still hold when the content delta is minimal but structurally present?

In what cases could this rule pose a problem?

On e-commerce sites with advanced personalization, content may vary based on the device for business reasons. Mobile-first pricing, different geo-targeted offers, rearranged product sections... If you genuinely serve a different catalog based on the device, the header is legitimate.

Be wary of AMP or dedicated mobile versions. If you still maintain separate URLs (m.site.com), this recommendation does not apply directly. The 'Vary: User-Agent' becomes crucial to prevent Google from serving the desktop version to mobile devices.

Be cautious of CMS plugins that activate 'Vary: User-Agent' by default. WordPress, Drupal, Magento... many caching modules add this header without you knowing. Regularly audit your HTTP headers.

Practical impact and recommendations

What actions should you take on your site?

Start with a complete audit of your HTTP headers. Use curl or a tool like Screaming Frog to extract all your 'Vary' headers from a representative sample of URLs. Then, compare the source HTML between desktop and mobile for each page type.

If you find that your site uses a pure CSS responsive design, remove the 'Vary: User-Agent' header immediately. You do not need it. However, if certain category or product pages load fewer elements on mobile, segment the application of the header only to those URLs.

What mistakes should be avoided at all costs?

Never configure the header at the global server level (Apache, Nginx) if all your pages do not require this treatment. Go down to the rules by page type, or even by URL if necessary. A poorly configured .htaccess can sabotage your caching performance.

Avoid also mixing multiple adaptive strategies on the same site. If you switch from adaptive design to pure responsive, clean up all the old headers. Hybrid configurations are the primary source of mobile-first indexing bugs.

How can you verify that your configuration is optimal?

Monitor your cache metrics before and after modifications. A good CDN shows a hit rate over 80% on static content. If you are below that after removing the header, it means other factors are fragmenting your cache (cookies, query strings...).

Also analyze your Search Console crawl reports. Disrupted mobile-first indexing due to poorly configured headers is indicated by significant discrepancies between discovered pages and indexed pages, or by high server response times in exploration stats.

  • Audit all your 'Vary' HTTP headers on a representative sample of URLs
  • Compare the desktop vs mobile source HTML for each key page type
  • Remove the header from pure CSS responsive pages with no HTML variation
  • Configure the header at the page level, not at the global server level
  • Monitor your CDN hit rates before and after changes
  • Check Search Console crawl reports to detect indexing anomalies
Optimizing HTTP headers like 'Vary: User-Agent' requires a keen understanding of your technical stack and your caching strategy. These adjustments, although technical, can transform your crawl performance and loading speed. If your team lacks expertise in these areas or if your infrastructure is complex, hiring a specialized technical SEO agency can accelerate compliance and avoid costly errors in your mobile-first indexing.

❓ Frequently Asked Questions

Le header 'Vary: User-Agent' ralentit-il vraiment le crawl de Google ?
Oui, quand il est mal appliqué. Google doit crawler plusieurs versions de la même URL (desktop, mobile, différents user-agents), ce qui consomme du crawl budget inutilement si le contenu est identique. Sur un gros site, cela peut retarder l'indexation de nouvelles pages de plusieurs jours.
Responsive CSS vs adaptatif HTML : comment faire la différence ?
Inspectez la source HTML. Si les balises, le contenu textuel et les images sont identiques entre desktop et mobile, vous êtes en responsive CSS pur. Si des blocs entiers disparaissent ou changent côté mobile dans le HTML, c'est de l'adaptatif qui justifie 'Vary: User-Agent'.
Mon CDN applique 'Vary: User-Agent' par défaut, est-ce un problème ?
Potentiellement. Cloudflare, Fastly et autres CDN offrent cette option, mais elle doit être activée uniquement si votre backend sert réellement du contenu différent. Vérifiez la config de votre CDN et désactivez cette règle si vous êtes en responsive pur.
Faut-il supprimer le header sur un site qui mélange responsive et adaptatif ?
Non, segmentez. Identifiez les URLs qui servent du HTML différent et n'appliquez le header que sur celles-ci via des règles serveur ciblées. Un site e-commerce peut avoir des fiches produits responsive mais des pages catégories adaptatives.
Comment tester si mon header 'Vary' impacte négativement mon indexation ?
Comparez vos logs serveur avant/après dans Search Console, section Statistiques d'exploration. Surveillez le nombre de pages crawlées par jour, le temps de téléchargement moyen et les erreurs serveur. Une hausse du crawl après retrait du header confirme l'impact positif.
🏷 Related Topics
Domain Age & History Content HTTPS & Security AI & SEO

🎥 From the same video 8

Other SEO insights extracted from this same Google Search Central video · duration 43 min · published on 28/05/2015

🎥 Watch the full video on YouTube →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.