Catalog/Dynamic serving without Vary: User-Agent (cache-poisoning risk)
SEO issue

Missing Vary: User-Agent: fix dynamic serving

Dynamic serving without a Vary: User-Agent header risks caches showing the wrong version to users and bots. Learn how to fix this cache-poisoning risk.

0
audited sites affected

What it means

Dynamic serving detects the visitor's device and returns different HTML for mobile versus desktop, but the cache key is based only on the URL. Without a Vary: User-Agent header, the cache stores one version and serves it to all requests, so mobile users (and Googlebot) get the desktop HTML—or vice versa.

Why it matters

Googlebot and the mobile indexer only use the mobile version of content, so a cache-poisoned response can serve the wrong markup, headings, or structured data to the crawler. The crawler then indexes stale or mismatched HTML, which can cause indexing gaps or incorrect rendering in Search Console. AI agents that read the same cached HTML will also see the wrong version.

How to fix it

  1. Add Vary: User-Agent to the response headers of your dynamic-serving layer so the cache distinguishes mobile and desktop variants.
  2. Verify the header is present on HTML responses using curl -I https://your-page and confirm the response includes Vary: User-Agent.
  3. If you use a CDN or reverse proxy, configure it to pass the Vary header through and purge any existing entries that were cached without it.

Example

Before — HTTP header
<!-- serving different HTML to mobile vs desktop at the same URL -->
Content-Type: text/html
# no Vary header
After — HTTP header
Content-Type: text/html
Vary: User-Agent

If one URL serves different markup by device (dynamic serving), send Vary: User-Agent so caches and CDNs don't hand the wrong version to a bot or user.

When it's not a problem

This is a false alarm if your server returns identical HTML for both mobile and desktop (content parity), or if you use responsive design with a single HTML template rather than separate mobile/desktop templates.

How Crawlinx detects it

When a URL appears to serve device-specific HTML, we check for a Vary: User-Agent response header. Its absence risks a cache serving the desktop version to mobile (or to Googlebot), so we flag it.

How common is it?

Not yet observed in our audit sample. We publish this explainer because the check runs on every crawl; once an audited site trips it, this page will break the issue down by platform, gatekeeper, vertical and country.

Related guides

Related
Catalog Canonical differs between mobile and desktop Mobile version has much less content than desktop Mobile version has far fewer internal links than desktop Meta description differs between mobile and desktop Indexability directive differs between mobile and desktop Structured data present on desktop but missing on mobile Title differs between mobile and desktop Missing viewport meta tag

Audit your own site — free

157 checks, internal PageRank, render-diff. No signup, results in ~30s.

Scan your site →