Hướng dẫn về Dynamic Serving

Điều gì dynamic serving là, đó hai jobs of đó Vary Người dùng-Agent header, vì sao đây là một legacy pattern, và cách điều này differs từ responsive design và dynamic kết xuất.

Xuất bản lần đầu: 2 thg 7, 2026 · Cập nhật lần cuối: 8 thg 8, 2026 · Advanced
Ngôn ngữ

Dynamic serving có nghĩa là một URL trả về khác nhau HTML/CSS depending on đó requesting người dùng-agent — desktop nhận một trang, mobile nhận một sản phẩm khác — và đó máy chủ phải gửi đó Vary: Người dùng-Agent header so caches và các crawler không serve đó sai version. đây là một of three mobile configurations (responsive, dynamic serving, tách biệt m-dot URLs), và Google khuyến nghị responsive design thay vì vì dynamic serving phụ thuộc vào lỗi-prone người dùng-agent detection và correct Vary các header. không confuse điều này với dynamic kết xuất (pre-kết xuất JS cho bots) — khác nhau concept, khác nhau doc. Trong 2026 đây là mostly một legacy pattern bạn audit an older hoặc enterprise site off of, không điều gì đó để xây dựng fresh: mobile-đầu tiên lập chỉ mục raised đó stakes of getting device serving sai, và Vary: Người dùng-Agent fragments CDN caches.

Tóm tắt — Dynamic serving = giống nhau URL, khác HTML/CSS theo người dùng-agent, detected máy chủ-side và signaled với Vary: User-Agent phản hồi header. nó một của three mobile configs alongside responsive design (Google khuyến nghị) và tách biệt các URL (m-dot). Vary header làm hai jobs: (1) dừng caches serving sai device version, và (2) trong lịch sử helped Googlebot discover mobile version. nó có thực cost, though — Vary: User-Agent fragments CDN bộ nhớ đệm keys across mỗi distinct UA string, multiplying origin load. Người dùng-agent detection là lỗi-prone (stale UA lists, tablets đọc as phones), và detection bug hoặc bị thiếu Vary có thể làm Google see sai hoặc hỏng version — mà là nơi cloaking risk thực ra lives. không confuse nó với dynamic kết xuất (pre-kết xuất JS cho các crawler — khác concept với của nó own doc). Trong 2026 nó legacy pattern để audit off của, không xây dựng 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

Điều gì dynamic serving là, precisely

Google own definition, từ của nó mobile-đầu tiên lập chỉ mục 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.” (bản dịch) «Dynamic serving: Dùng đó giống nhau URL regardless of device. Này configuration relies on người dùng-agent sniffing và đó Vary: user-agent HTTP header phản hồi để serve một khác nhau version of đó HTML để khác nhau devices.» Đó hiện tại-retired dedicated Google trang put điều này even hơn concretely — dynamic serving là “a setup where the server responds with different HTML (and CSS) on the same URL depending on which user agent requests the page (mobile, tablet, or desktop).” (bản dịch) «một setup nơi đó máy chủ responds với khác nhau HTML (và CSS) on đó giống nhau URL depending on mà người dùng agent các yêu cầu đó trang (mobile, tablet, hoặc desktop).»

nó một của three mobile configurations, và sạch nhất way để see nó là three-hàng bảng:

Configurationgiống nhau URL?giống nhau HTML?Chính tín hiệu được sử dụng
Responsive designCSS media các truy vấn (không có gì máy chủ-side)
Dynamic servingKhông (by người dùng-agent)Vary: User-Agent header
Tách biệt các URL (m-dot)KhôngKhôngrel=canonical/rel=alternate + Vary

Hai of những three phụ thuộc on đó Vary header. Google là rõ ràng đó tách biệt URLs, “like dynamic serving, this configuration relies on the user-agent and Vary HTTP headers.” (bản dịch) «như dynamic serving, này configuration relies on người dùng-agent và Vary HTTP các header.» Chỉ responsive design có không có gì để nhận out of sync — mà là chính xác vì sao Google khuyến nghị điều này (see đó responsive design deep dive, và cách all three fit together trong đó mobile SEO hub).

Cách nó hoạt động: người dùng-agent detection + Vary header

máy chủ inspects incoming người dùng-agent string — identifier mỗi client gửi — decides liệu nó mobile, tablet, hoặc desktop device, và trả về matching HTML. vì URL là giống hệt cho mọi người, máy chủ sau đó có để announce đó phản hồi varies by người dùng-agent. đó Vary: User-Agent header, và Google archived hướng dẫn là precise đó nó làm hai distinct jobs — không collapse them vào một:

“It signals to caching 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 Googlebot 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.” (bản dịch) «Điều này các tín hiệu để bộ nhớ đệm các máy chủ dùng trong ISPs và elsewhere đó they nên consider người dùng agent khi deciding liệu để serve đó trang từ bộ nhớ đệm hoặc không. Không có đó Vary HTTP header, một bộ nhớ đệm có thể mistakenly serve mobile người dùng đó bộ nhớ đệm of đó desktop HTML trang hoặc vice versa. Điều này helps Googlebot discover của bạn mobile-optimized nội dung nhanh hơn, as một hợp lệ Vary HTTP header là một of đó các tín hiệu we có thể dùng để crawl URLs đó serve mobile-optimized nội dung.»

So job một là bộ nhớ đệm correctness — pure UX/correctness concern independent của cácông cụ tìm kiếm — và job hai là crawl phát hiện. phần lớn đối thủ glossary các trang chỉ mention đầu tiên (hoặc blur hai). Trong thực HTTP phản hồi nó looks như điều này:

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

nếu của bạn máy chủ đã gửi Vary header cho điều gì đó khác (như Accept-Encoding), bạn thêm User-Agent để list thay vì thay thế nó.

Worth separating rõ ràng: Vary itself là đơn giản HTTP bộ nhớ đệm mechanism, không SEO invention. nó tells bộ nhớ đệmà yêu cầu các header để fold vào bộ nhớ đệmấu chốt so nó có thể store right variant — nó không detect devices hoặc understand SEO tại all; của bạn máy chủ người dùng-agent logic làm đó riêng, và Google crawl-phát hiện sử dụng của header (job hai, trên) là Google own characterization của tín hiệu nó watches cho, không bộ nhớ đệm-giao thức requirement mỗi bộ nhớ đệm follows giống nhau way. gửi nó consistently cho được cho URL — including on 304 Not Modified các phản hồi và bất kỳ default/fallback phản hồi — hoặc bộ nhớ đệm có thể end lên holding inconsistent metadata về Điều gì nó storing.

cost phần lớn các hướng dẫn skip: CDN bộ nhớ đệm fragmentation

Ở đây angle gần như mỗi xếp hạng trang misses. Vary: User-Agent không phải free — nó fragments của bạn bộ nhớ đệm. bộ nhớ đệm keys entries partly on Vary-listed các header, so Vary: User-Agent có nghĩ là tách biệt được lưu đệm copy cho mỗi distinct người dùng-agent string đó hits trang web: mỗi trình duyệt version, mỗi OS xây dựng, mỗi bot. đó thousands của variants cho nội dung đó chỉ thực sự có hai hoặc three thực versions — though chính xácách nhiều reuse bạn lose phụ thuộc vào của bạn CDN’s own bộ nhớ đệm-mấu chốt xử lý (some normalize hoặc group similar người dùng-agent strings, phần lớn không), so có không single universal hit-rate mất mát để quote; treat bất kỳ cụ thể multiplier, including SiteGround dưới, as một vendor estimate thay vì guaranteed number cho của bạn stack.

SiteGround put đó 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.” (bản dịch) «Với người dùng-Agent [header] enabled, đó hệ thống sẽ giữ khác nhau copies cho mỗi combination of OS và trình duyệt version visiting trang web của bạn… bạn sẽ có 5-30 dynamic các yêu cầu cho đó giống nhau 100 visits. So đó very giống nhau site sẽ dùng 5-30 times đó các tài nguyên.» Và này hits các crawler hard: “If such [a] bot starts crawling 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.” (bản dịch) «Nếu such [một] bot bắt đầu crawling trang web của bạn và bạn có đó Vary: Người dùng-Agent header, mỗi yêu cầu điều này làm để trang web của bạn sẽ là một dynamic một và sẽ eat lên của bạn các tài nguyên.»

Này không new. Back trong 2013, Cindy Krum warned trong Search Engine Land đó enterprise CDNs treated đó header as mộtín hiệu đó nội dung “cannot be cached or served from the CDN and must be fetched directly from your server” (bản dịch) «không thể là được lưu đệm hoặc phân phối từ đó CDN và phải được fetched trực tiếp từ máy chủ của bạn» — potentially “rendering your CDN completely useless” (bản dịch) «kết xuất của bạn CDN completely useless» cho dynamically-phân phối các trang. Đó cụ thể 2013 vendor behavior có changed, nhưng đó underlying tension — Vary: User-Agent fragments bộ nhớ đệm keys — là vẫn technically real, và đây là một major reason dynamic serving fell out of favor even among các trang đó đã không worried về SEO. SiteGround cũng làm đó practical point đó “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” (bản dịch) «hầu hết of đó các trang không thực ra serve khác nhau HTML cho của họ mobile versions. đây là đó responsive CSS đó làm all đó nặng lifting» — meaning một lot of Vary: User-Agent các header trong đó wild là đơn giản leftover misconfigurations on các trang đó là thực sự responsive.

là dynamic serving cloaking?

Không — không inherently. risk là về outcome và intent, không technique. Detecting device và serving nó device-appropriate nội dung là fine; danger là either () detection bug hoặc bị thiếu Vary header đó accidentally phục vụ Googlebot sai hoặc hỏng version, hoặc (b) có chủ ý serving cácông cụ tìm kiếm meaningfully khác nội dung hơn người dùng nhận. Google own archived dynamic-serving hướng dẫn là blunt về 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.” (bản dịch) «Là very careful of cloaking khi detecting người dùng agents… điều này không nên là looking cụ thể cho Googlebot. All Googlebot người dùng agents identify themselves as cụ thể mobile devices, và bạnên treat những Googlebot người dùng agents chính xác như bạn sẽ treat những devices.»

Đó parallel là Google vẫn-trực tiếp dynamic kết xuất doc, mà trạng thái đó chung principle cho đó related JS-kết xuất case: “As long as your dynamic rendering produces similar content, Googlebot won’t view dynamic rendering as cloaking,” (bản dịch) «Miễn là của bạn dynamic kết xuất produces similar nội dung, Googlebot sẽ không view dynamic kết xuất as cloaking,» trong khi “serving completely different content to users and crawlers can be considered cloaking.” (bản dịch) «serving completely khác nhau nội dung để người dùng và các crawler có thể là considered cloaking.» Giống nhau logic áp dụng để dynamic serving: substantially-đó-giống nhau nội dung phân phối theo device là fine; một misconfiguration đó looks như cloaking là đó real danger.

Dynamic serving so với. dynamic kết xuất — không confuse những điều này

Đây là single clearest điều phần lớn competing nội dung nhận sai, so nó worth hard line:

  • Dynamic serving = device variance. Giống nhau URL, khác nhau HTML cho mobile so với. desktop. Đó topic of này trang. Google folded của nó hướng dẫn vào đó mobile-đầu tiên lập chỉ mục doc.
  • Dynamic kết xuất = JS-kết xuất variance cho bots. Serving một pre-được kết xuất/ máy chủ-được kết xuất version of một JavaScript-nặng trang để các crawler trong khi người dùng nhận đó client-được kết xuất version. Điều này có của nó own dedicated, vẫn-trực tiếp Google doc, và Bing covers điều này trong của nó 2018 bingbot post (“Dynamic rendering is about detecting user agent and rendering content differently for humans and search engine crawlers” (bản dịch) «Dynamic kết xuất là về detecting người dùng agent và kết xuất nội dung differently cho humans và công cụ tìm kiếm các crawler» — note: đó là về JS kết xuất cho bingbot, không device-based serving).

họ’re easy để conflate vì cả hai sử dụngười dùng-agent detection và cả hai raise cloaking câu hỏi — nhưng họ’re khácác vấn đề với khác tài liệu.

Người dùng-agent detection là genuinely lỗi-prone

Google archived hướng dẫn listed đó phổ biến các chế độ lỗi, và they vẫn hold: người dùng-agent lists cần constant maintenance và sẽ không match brand-new agents; đây là easy để mismatch — “sometimes detecting a desktop user agent as a mobile one or detecting a mobile user agent as a desktop” (bản dịch) «sometimes detecting một desktop người dùng agent as một mobile một hoặc detecting một mobile người dùng agent as một desktop»; và một cụ thể classic, “a common mistake for sites is to inadvertently treat tablet devices as smartphones.” (bản dịch) «một lỗi thường gặp cho các trang là để inadvertently treat tablet devices as smartphones.» Google own summary — “Use the Vary HTTP header to signal your changes depending on the user agent. Detect user agent strings correctly.” (bản dịch) «Dùng đó Vary HTTP header để tín hiệu của bạn thay đổi depending on người dùng agent. Detect người dùng agent strings correctly.» — sounds đơn giản nhưng là đó toàn bộ maintenance burden trong hai sentences.

Google có fielded những mistakes cho một decade. Back trong January 2015, Pierre Far of Google flagged đó top implementation các vấn đề he saw — khoảng xử lý JavaScript, CSS, và image variants correctly across devices, không chỉ đó Vary header — một reminder đó “add the header” (bản dịch) «thêm đó header» đã là không bao giờ đó toàn bộ story.

Vì sao responsive design là hiện tại default

Hai forces đã làm dynamic serving một legacy pattern. Đầu tiên, Google có được khuyến nghị responsive design “because it’s the easiest design pattern to implement and maintain” (bản dịch) «vì đây là đó easiest design pattern để implement và maintain» since ít nhất 2015 — một version, không device-detection risk tại all. Second, mobile-đầu tiên lập chỉ mục đã hoàn tất trong 2023–2024, mà raised đó stakes of getting device serving sai: đó mobile version là hiện tại đó version Google primarily crawl, indexes, và ranks, so một dynamic-serving misconfiguration không chỉ serve Googlebot một bad mobile trang — điều này serves Googlebot của bạn chính được lập chỉ mục nội dung, sai. Đó giống nhau push away từ device-cụ thể setups đó áp dụng để tách biệt m-dot URLs áp dụng để dynamic serving cũng: consolidate để một responsive URL và đó toàn bộ class of các vấn đề disappears.

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

cho đầy đủ mobile picture — nội dung parity, Core Web Vitals on mobile, usability, interstitials, và nơi AMP stands — see mobile SEO hub và mobile SEO checklist.

Cách kiểm tra nếu trang web dùng dynamic serving

Concrete và fast: yêu cầu giống nhau URL twice với khác người dùng-agent strings và so sánh. nếu HTML differs và phản hồi carries Vary: User-Agent, nó dynamic serving. nếu HTML là giống hệt (và nó chỉ re-luồng qua CSS), nó responsive. Scripts tab có curl, DevTools, và bookmarklet versions. tell để watch cho: HTML đó differs by device nhưng không Vary header — đó misconfiguration đó risks caches và các crawler seeing sai version.

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

Add an expert note

Pin an expert quote

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