Dynamic Serving

What dynamic serving is, the two jobs of the Vary User-Agent header, why it's a legacy pattern, and how it differs from responsive design and dynamic rendering.

First published: Jul 2, 2026 · Last updated: Jul 18, 2026 · Advanced
demand #8 in Mobile SEO#249 in Technical SEO#338 on the site

Dynamic serving means one URL returns different HTML/CSS depending on the requesting user-agent — desktop gets one page, mobile gets another — and the server must send the Vary: User-Agent header so caches and crawlers don't serve the wrong version. It's one of three mobile configurations (responsive, dynamic serving, separate m-dot URLs), and Google recommends responsive design instead because dynamic serving depends on error-prone user-agent detection and correct Vary headers. Don't confuse it with dynamic rendering (pre-rendering JS for bots) — different concept, different doc. In 2026 it's mostly a legacy pattern you audit an older or enterprise site off of, not something to build fresh: mobile-first indexing raised the stakes of getting device serving wrong, and Vary: User-Agent fragments CDN caches.

TL;DR — Dynamic servingA mobile configuration where the server returns different HTML/CSS from the same URL depending on the requesting user-agent (desktop vs. mobile), signaled with the Vary: User-Agent header. = same URL, different HTML/CSS per user-agentA user agent is the HTTP request header a client (browser, crawler, or bot) sends to identify itself. For crawlers, a short user-agent token — a substring of that string — is what robots.txt rules actually target., detected server-side and signaled with the Vary: User-Agent response header. It’s one of three mobile configs alongside responsive designA mobile configuration that serves the same HTML on the same URL to every device and uses CSS media queries to adapt the layout to the viewport. It's Google's recommended setup and requires a correct viewport meta tag to work. (Google’s recommendation) and separate URLs (m-dot). The Vary header does two jobs: (1) stops caches serving the wrong device’s version, and (2) historically helped GooglebotGooglebot is Google's web crawler — the software that fetches pages so Google can index and rank them. It comes in two variants, Googlebot Smartphone (primary, under mobile-first indexing) and Googlebot Desktop, and runs an evergreen Chromium renderer. discover the mobile version. It has a real cost, though — Vary: User-Agent fragments CDN cache keys across every distinct UA string, multiplying origin load. User-agent detection is error-prone (stale UA lists, tablets read as phones), and a detection bug or missing Vary can make Google see the wrong or broken version — which is where the cloaking risk actually lives. Don’t confuse it with dynamic renderingTurning HTML, CSS, and JavaScript into the final visual page and DOM. (pre-renderingTurning HTML, CSS, and JavaScript into the final visual page and DOM. JS for crawlersA crawler — also called a spider or bot — is an automated program that fetches web pages, extracts their links, and queues new URLs to visit. Search engines use crawlers to discover and download content for their index. — a different concept with its own doc). In 2026 it’s a legacy pattern to audit off of, not build fresh.

Evidence for this claim Dynamic serving uses one URL with device-dependent HTML and should send Vary: User-Agent. Scope: Current official or standards documentation. Confidence: high · Verified: Google: Mobile configurations Evidence for this claim Google supports dynamic serving but recommends responsive design because it is easier to implement and maintain. Scope: Current official or standards documentation. Confidence: high · Verified: Google: Mobile-first indexing

What dynamic serving is, precisely

Google’s own definition, from its mobile-first indexingGoogle's practice of using the mobile version of a page's content — crawled by Googlebot smartphone — for indexing and ranking. It is not a separate index and not a ranking boost. best-practices doc: “Dynamic serving: Uses the same URL regardless of device. This configuration relies on user-agent sniffing and the Vary: user-agent HTTP response header to serve a different version of the HTML to different devices.” The now-retired dedicated Google page put it even more concretely — dynamic serving is “a setup where the server responds with different HTML (and CSS) on the same URL depending on which user agentA user agent is the HTTP request header a client (browser, crawler, or bot) sends to identify itself. For crawlers, a short user-agent token — a substring of that string — is what robots.txt rules actually target. requests the page (mobile, tablet, or desktop).”

It’s one of three mobile configurations, and the cleanest way to see it is a three-row table:

ConfigurationSame URL?Same HTML?Primary signal used
Responsive designYesYesCSS media queries (nothing server-side)
Dynamic servingYesNo (by user-agent)Vary: User-Agent header
Separate URLs (m-dot)NoNorel=canonical/rel=alternate + Vary

Two of these three depend on the Vary header. Google is explicit that separate URLs, “like dynamic serving, this configuration relies on the user-agent and Vary HTTP headers.” Only responsive design has nothing to get out of sync — which is exactly why Google recommends it (see the responsive designA mobile configuration that serves the same HTML on the same URL to every device and uses CSS media queries to adapt the layout to the viewport. It's Google's recommended setup and requires a correct viewport meta tag to work. deep dive, and how all three fit together in the mobile SEOMobile SEO is the practice of optimizing a site so it ranks well when crawled and indexed by a mobile (smartphone) user agent and delivers a fast, usable experience on phones. Since Google completed mobile-first indexing, the mobile version is the primary version Google uses for indexing and ranking — so mobile SEO is effectively baseline SEO for every site. hub).

How it works: user-agent detection + the Vary header

The server inspects the incoming user-agent string — the identifier every client sends — decides whether it’s a mobile, tablet, or desktop device, and returns the matching HTML. Because the URL is identical for everyone, the server then has to announce that the response varies by user-agent. That’s the Vary: User-Agent header, and Google’s archived guidance is precise that it does two distinct jobs — don’t collapse them into one:

“It signals to cachingCaching stores a copy of a page or resource — in a browser, a CDN edge node, or a search crawler's own cache — so it can be served again without regenerating or re-downloading it. It isn't a direct ranking factor, but it feeds page speed and crawl efficiency. servers used in ISPs and elsewhere that they should consider the user agent when deciding whether to serve the page from cache or not. Without the Vary HTTP header, a cache may mistakenly serve mobile users the cache of the desktop HTML page or vice versa. It helps GooglebotGooglebot is Google's web crawler — the software that fetches pages so Google can index and rank them. It comes in two variants, Googlebot Smartphone (primary, under mobile-first indexing) and Googlebot Desktop, and runs an evergreen Chromium renderer. discover your mobile-optimized content faster, as a valid Vary HTTP header is one of the signals we may use to crawl URLs that serve mobile-optimized content.”

So job one is cache correctness — a pure UX/correctness concern independent of search engines — and job two is crawl discovery. Most competitor glossary pages only mention the first (or blur the two). In a real HTTP response it looks like this:

HTTP/1.1 200 OK
Content-Type: text/html
Vary: User-Agent
Content-Length: 5710

If your server already sends a Vary header for something else (like Accept-Encoding), you add User-Agent to the list rather than replacing it.

Worth separating clearly: Vary itself is a plain HTTP caching mechanism, not an SEO invention. It tells a cache which request headers to fold into the cache key so it can store the right variant — it doesn’t detect devices or understand SEO at all; your server’s user-agent logic does that separately, and Google’s crawl-discovery use of the header (job two, above) is Google’s own characterization of a signal it watches for, not a caching-protocol requirement every cache follows the same way. Send it consistently for a given URL — including on 304 Not Modified responses and any default/fallback response — or a cache can end up holding inconsistent metadata about what it’s storing.

The cost most guides skip: CDN cache fragmentation

Here’s the angle almost every ranking page misses. Vary: User-Agent is not free — it fragments your cache. A cache keys entries partly on the Vary-listed headers, so Vary: User-Agent means a separate cached copy for every distinct user-agent string that hits the site: every browser version, every OS build, every bot. That’s thousands of variants for content that only really has two or three real versions — though exactly how much reuse you lose depends on your CDN’s own cache-key handling (some normalize or group similar user-agent strings, most don’t), so there’s no single universal hit-rate loss to quote; treat any specific multiplier, including SiteGround’s below, as one vendor’s estimate rather than a guaranteed number for your stack.

SiteGround put the practical cost plainly: “With the User-Agent [header] enabled, the system will keep different copies for each combination of OS and browser version visiting your site… you will have 5-30 dynamic requests for the same 100 visits. So the very same site will use 5-30 times the resources.” And this hits crawlersA crawler — also called a spider or bot — is an automated program that fetches web pages, extracts their links, and queues new URLs to visit. Search engines use crawlers to discover and download content for their index. hard: “If such [a] bot starts crawlingCrawling is how search engines use automated bots (like Googlebot and Bingbot) to discover URLs and download pages. A page has to be crawlable to be indexed, but crawling on its own isn't a ranking factor. your site and you have the Vary: User-Agent header, each request it makes to your site would be a dynamic one and will eat up your resources.”

This isn’t new. Back in 2013, Cindy Krum warned in Search Engine Land that enterprise CDNs treated the header as a signal that content “cannot be cached or served from the CDN and must be fetched directly from your server” — potentially “rendering your CDN completely useless” for dynamically-served pages. The specific 2013 vendor behavior has changed, but the underlying tension — Vary: User-Agent fragments cache keys — is still technically real, and it’s a major reason dynamic serving fell out of favor even among sites that weren’t worried about SEO. SiteGround also makes the practical point that “most of the sites don’t actually serve different HTML for their mobile versions. It’s the responsive CSS that does all the heavy lifting” — meaning a lot of Vary: User-Agent headers in the wild are simply leftover misconfigurations on sites that are really responsive.

Is dynamic serving cloaking?

No — not inherently. The risk is about outcome and intent, not the technique. Detecting a device and serving it device-appropriate content is fine; the danger is either (a) a detection bug or missing Vary header that accidentally serves Googlebot the wrong or broken version, or (b) deliberately serving search engines meaningfully different content than users get. Google’s own archived dynamic-serving guidance was blunt about the trap:

“Be very careful of cloaking when detecting user agents… it should not be looking specifically for Googlebot. All Googlebot user agents identify themselves as specific mobile devices, and you should treat these Googlebot user agents exactly like you would treat these devices.”

The parallel is Google’s still-live dynamic rendering doc, which states the general principle for the related JS-rendering case: “As long as your dynamic rendering produces similar content, Googlebot won’t view dynamic rendering as cloaking,” while “serving completely different content to users and crawlers can be considered cloaking.” Same logic applies to dynamic serving: substantially-the-same content served per device is fine; a misconfiguration that looks like cloaking is the real danger.

Dynamic serving vs. dynamic rendering — don’t confuse these

This is the single clearest thing most competing content gets wrong, so it’s worth a hard line:

  • Dynamic serving = device variance. Same URL, different HTML for mobile vs. desktop. The topic of this page. Google folded its guidance into the mobile-first indexingStoring a crawled page in the search index so it can appear in results. Crawled is not the same as indexed — Google selects what to keep, and indexing isn't guaranteed. doc.
  • Dynamic rendering = JS-rendering variance for bots. Serving a pre-rendered/ server-rendered version of a JavaScript-heavy page to crawlers while users get the client-rendered version. It has its own dedicated, still-live Google doc, and Bing covers it in its 2018 bingbot post (“Dynamic rendering is about detecting user agent and rendering content differently for humans and search engine crawlers” — note: that’s about JS rendering for bingbotBingbot is Microsoft Bing's primary web crawler — the bot that discovers, fetches, and renders pages to build the Bing index. That index also powers Yahoo, DuckDuckGo, Ecosia, and Microsoft Copilot, so Bingbot's reach is far wider than Bing's own search-market share., not device-based serving).

They’re easy to conflate because both use user-agent detection and both raise the cloaking question — but they’re different problems with different docs.

User-agent detection is genuinely error-prone

Google’s archived guidance listed the common failure modes, and they still hold: user-agent lists need constant maintenance and won’t match brand-new agents; it’s easy to mismatch — “sometimes detecting a desktop user agent as a mobile one or detecting a mobile user agent as a desktop”; and a specific classic, “a common mistake for sites is to inadvertently treat tablet devices as smartphones.” Google’s own summary — “Use the Vary HTTP header to signal your changes depending on the user agent. Detect user agent strings correctly.” — sounds simple but is the whole maintenance burden in two sentences.

Google has fielded these mistakes for a decade. Back in January 2015, Pierre Far of Google flagged the top implementation problems he saw — around handling JavaScript, CSS, and image variants correctly across devices, not just the Vary header — a reminder that “add the header” was never the whole story.

Why responsive design is now the default

Two forces made dynamic serving a legacy pattern. First, Google has recommended responsive design “because it’s the easiest design pattern to implement and maintain” since at least 2015 — one version, no device-detection risk at all. Second, mobile-first indexingGoogle's practice of using the mobile version of a page's content — crawled by Googlebot smartphone — for indexing and ranking. It is not a separate index and not a ranking boost. completed in 2023–2024, which raised the stakes of getting device serving wrong: the mobile version is now the version Google primarily crawls, indexes, and ranks, so a dynamic-serving misconfiguration doesn’t just serve Googlebot a bad mobile page — it serves Googlebot your primary indexed content, wrong. The same push away from device-specific setups that applies to separate m-dot URLsGoogle's practice of using the mobile version of a page's content — crawled by Googlebot smartphone — for indexing and ranking. It is not a separate index and not a ranking boost. applies to dynamic serving too: consolidate to one responsive URL and the whole class of problems disappears.

For the full mobile picture — content parity, Core Web VitalsGoogle's three real-user UX metrics — LCP (loading), INP (responsiveness), and CLS (visual stability) — used by Google's ranking systems, with no official weight attached, measured on field data. on mobile, usability, interstitialsIn SEO, interstitials are full-page popups or overlays that block the main content of a page. Google demotes pages with intrusive interstitials shown on the transition from a search click — a page-level signal, with legal gates, login walls, and small dismissible banners exempted., and where AMPAMP (Accelerated Mobile Pages) is an open-source web framework Google launched in 2015 to make mobile pages load near-instantly via restricted HTML/CSS/JS and CDN caching. It was never a ranking factor and, since June 2021, is no longer required for Top Stories. stands — see the mobile SEOMobile SEO is the practice of optimizing a site so it ranks well when crawled and indexed by a mobile (smartphone) user agent and delivers a fast, usable experience on phones. Since Google completed mobile-first indexing, the mobile version is the primary version Google uses for indexing and ranking — so mobile SEO is effectively baseline SEO for every site. hub and the mobile SEO checklist.

How to check if a site uses dynamic serving

Concrete and fast: request the same URL twice with different user-agent strings and compare. If the HTML differs and the response carries Vary: User-Agent, it’s dynamic serving. If the HTML is identical (and it just re-flows via CSS), it’s responsive. The Scripts tab has curl, DevTools, and bookmarklet versions. The tell to watch for: HTML that differs by device but no Vary header — that’s the misconfiguration that risks caches and crawlers seeing the wrong version.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.