rendering-strategies

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SEO Technical: Rendering Strategies

SEO技术:渲染策略

Guides rendering strategy selection and optimization for search engine and AI crawler visibility. Golden rule: Page data and metadata must be available on page load without JavaScript execution for optimal SEO.
When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
用于指导为提升搜索引擎和AI爬虫可见性的渲染策略选择与优化。黄金法则:为实现最优SEO效果,页面数据和元数据必须在无需执行JavaScript的情况下,页面加载时即可获取。
调用规则:首次使用时,如果有帮助,可以先用1-2句话介绍本技能覆盖的内容及其重要性,再提供核心输出。后续使用或用户要求跳过说明时,直接输出核心内容即可。

Scope (Technical SEO)

适用范围(技术SEO)

  • Static vs dynamic: SSG, SSR, ISR, CSR; when to use each
  • Crawler behavior: Googlebot renders JS (with delays); AI crawlers do not
  • Component-level: Content in initial HTML; tabs, carousels, nav
  • Dynamic rendering: Prerender for bots when full SSR/SSG is not feasible
  • 静态vs动态:SSG、SSR、ISR、CSR的适用场景
  • 爬虫行为:Googlebot会渲染JS(存在延迟);AI爬虫不会执行JS
  • 组件层面:初始HTML中的内容;标签页、轮播图、导航栏
  • 动态渲染:在无法实现完整SSR/SSG时为爬虫提供预渲染内容

Rendering Methods

渲染方法

MethodWhen HTML generatedSEOBest for
SSG (Static Site Generation)Build time✅ BestBlog, docs, marketing pages; content rarely changes
SSR (Server-Side Rendering)Request time✅ GoodNews, product pages; dynamic, personalized content
ISR (Incremental Static Regeneration)Build + revalidate✅ GoodLarge sites; static with periodic updates
CSR (Client-Side Rendering)Browser (after JS)❌ PoorDashboards, account pages; no SEO needed
Dynamic renderingOn-demand for bots✅ FallbackSPAs; prerender for crawlers, SPA for users
方法HTML生成时机SEO效果适用场景
SSG(静态站点生成)构建阶段✅ 最优博客、文档、营销页面;内容更新频率低
SSR(服务端渲染)请求触发时✅ 良好新闻、产品页面;动态、个性化内容
ISR(增量静态再生)构建+重新验证时✅ 良好大型站点;需要定期更新的静态内容
CSR(客户端渲染)浏览器端(JS加载后)❌ 较差仪表盘、账户页面;无需SEO的场景
动态渲染按需为爬虫生成✅ 备选方案SPA;为爬虫提供预渲染内容,为普通用户提供SPA

SSG (Static Site Generation)

SSG(静态站点生成)

HTML generated at build time; same HTML for every request. Best for SEO: crawlers receive full HTML immediately; optimal performance.
  • Use when: Blog, docs, marketing pages, content that doesn't change frequently
  • Framework: Next.js
    getStaticProps
    , Astro, Gatsby
HTML在构建阶段生成,所有请求返回的HTML都相同。SEO效果最优:爬虫可立即获取完整HTML,性能最佳。
  • 适用场景:博客、文档、营销页面、更新频率低的内容
  • 支持框架:Next.js
    getStaticProps
    、Astro、Gatsby

SSR (Server-Side Rendering)

SSR(服务端渲染)

HTML generated on each request. Good for SEO: crawlers receive complete HTML; supports dynamic, personalized content.
  • Use when: News, product pages, user-specific content
  • Tradeoff: Higher server load; slower TTFB than SSG
  • Framework: Next.js
    getServerSideProps
    , Remix
HTML在每次请求时生成。SEO效果良好:爬虫可获取完整HTML,支持动态、个性化内容。
  • 适用场景:新闻、产品页面、用户专属内容
  • 缺点:服务器负载更高;TTFB比SSG慢
  • 支持框架:Next.js
    getServerSideProps
    、Remix

ISR (Incremental Static Regeneration)

ISR(增量静态再生)

Static at build; pages can revalidate after a period. Good for SEO: combines static performance with freshness.
  • Use when: Large sites (millions of pages); content updates periodically
  • Framework: Next.js
    revalidate
    in
    getStaticProps
构建时生成静态页面,页面可在一段时间后重新验证更新。SEO效果良好:兼具静态页面性能和内容新鲜度。
  • 适用场景:大型站点(百万级页面);内容定期更新的场景
  • 支持框架:Next.js
    getStaticProps
    中的
    revalidate
    配置

CSR (Client-Side Rendering)

CSR(客户端渲染)

Server sends minimal HTML shell; content renders in browser after JS loads. Not for SEO: crawlers may see empty content; indexing delays or failures.
  • Use when: Dashboards, account pages, internal tools—no search visibility needed
  • Avoid for: Public content, marketing pages, blog
服务端返回最小HTML壳,内容在JS加载完成后在浏览器端渲染。不适用于SEO:爬虫可能获取到空内容,导致索引延迟或失败。
  • 适用场景:仪表盘、账户页面、内部工具——无需搜索曝光的页面
  • 避免用于:公开内容、营销页面、博客

Dynamic Rendering

动态渲染

Serve prerendered HTML to crawlers; serve SPA to users. Fallback when full SSR/SSG is not feasible (e.g. legacy SPA migration).
  • How: Detect crawler user-agent; route to prerender service (e.g. Prerender.io) or headless render
  • When: JavaScript-heavy sites; migration period; product/docs with CSR
  • Note: Google permits this; prerendered content should match user experience
向爬虫返回预渲染的HTML,向普通用户返回SPA。是无法实现完整SSR/SSG时的备选方案(例如遗留SPA迁移阶段)。
  • 实现方式:检测爬虫用户代理;将请求路由到预渲染服务(例如Prerender.io)或无头渲染服务
  • 适用场景:重度依赖JavaScript的站点;迁移过渡期;使用CSR的产品/文档站点
  • 注意事项:Google允许该方案;预渲染内容需与用户实际体验一致

Crawler Behavior

爬虫行为

CrawlerJavaScriptContent in initial HTML
GooglebotRenders JS (Chrome); may have multi-day queueFull weight; SSR/SSG preferred
AI crawlers (GPTBot, ClaudeBot, PerplexityBot)Do not execute JSRequired—CSR content invisible
BingbotRenders JSSame as Googlebot
AI crawlers: ~28% of Googlebot's crawl volume. Critical content (articles, meta, nav) must be in initial HTML. See site-crawlability for AI crawler optimization; generative-engine-optimization for GEO.
爬虫类型JavaScript支持初始HTML内容权重
Googlebot渲染JS(基于Chrome);可能存在数天的队列延迟权重最高;优先使用SSR/SSG
AI爬虫(GPTBot、ClaudeBot、PerplexityBot)执行JS必须包含——CSR内容对其不可见
Bingbot渲染JS与Googlebot规则一致
AI爬虫:占Googlebot爬取量的28%左右。核心内容(文章、元数据、导航)必须包含在初始HTML中。AI爬虫优化可参考site-crawlability技能;GEO优化可参考generative-engine-optimization技能。

Component-Level: Content in Initial HTML

组件层面:初始HTML中的内容

Google does not simulate user clicks (tabs, carousels, "Load more"). Content loaded via AJAX or on interaction is not discoverable.
ComponentRequirementImplementation
Tabs / AccordionAll tab content in DOM at loadServer-render; use
<details>
/
<summary>
or CSS show/hide
CarouselAll slides in initial HTMLServer-render; CSS/JS for show/hide only
HeroHeadline, CTA, LCP image in HTMLNo JS-only rendering
NavigationAll nav links in first paintNo JS-injected menus for critical links
Recommendation: Server-render (SSR/SSG) all critical content; use JS only for interaction (show/hide, animation). Content loaded on click = not indexed.
Google不会模拟用户点击(标签页、轮播图、「加载更多」)。通过AJAX或用户交互加载的内容无法被爬虫发现。
组件要求实现方式
标签页/手风琴组件所有标签内容在加载时已存在于DOM中服务端渲染;使用
<details>
/
<summary>
标签或CSS控制显隐
轮播图所有轮播内容在初始HTML中服务端渲染;仅用CSS/JS控制显隐
Hero区标题、CTA、LCP图片包含在HTML中不要仅用JS渲染
导航栏所有导航链接在首屏渲染时已存在核心链接不要使用JS注入的菜单
建议:所有核心内容使用服务端渲染(SSR/SSG);JS仅用于交互(显隐、动画)。点击后才加载的内容不会被索引。

Decision Guide

决策指南

Content typeRenderingReason
Blog, docs, marketingSSG or ISRBest SEO; fast; static
Product, news, dynamicSSRFresh content; crawler-ready
Dashboard, accountCSRNo SEO; auth required
Legacy SPADynamic renderingBridge until SSR/SSG migration
内容类型渲染方案原因
博客、文档、营销页面SSG或ISRSEO效果最好;加载快;静态内容
产品页、新闻、动态内容SSR内容新鲜;爬虫友好
仪表盘、账户页面CSR无需SEO;需要鉴权
遗留SPA动态渲染迁移到SSR/SSG前的过渡方案

Output Format

输出格式

  • Current setup: SSG, SSR, CSR, or hybrid
  • Recommendation: By page type
  • Component checks: Tabs, carousel, nav—content in initial HTML?
  • References: Next.js Rendering, Vercel SSR vs SSG
  • 当前配置:SSG、SSR、CSR或混合方案
  • 优化建议:按页面类型区分
  • 组件检查:标签页、轮播图、导航——内容是否存在于初始HTML中?
  • 参考资料Next.js渲染指南Vercel SSR vs SSG对比

Related Skills

相关技能

  • site-crawlability: AI crawler optimization; SSR for critical content; URL management
  • generative-engine-optimization: GEO; AI crawlers don't execute JS
  • core-web-vitals: LCP; SSR/SSG for above-fold; client-side hurts LCP
  • mobile-friendly: Mobile-first indexing; content parity
  • tab-accordion: Content in DOM at load; server-render tabs
  • carousel: Content in initial HTML; server-render slides
  • hero-generator: Hero in initial HTML; avoid JS-only
  • navigation-menu-generator: Nav in first paint; no JS-only menus
  • site-crawlability:AI爬虫优化;核心内容SSR;URL管理
  • generative-engine-optimization:GEO;AI爬虫不执行JS
  • core-web-vitals:LCP;首屏内容使用SSR/SSG;客户端渲染会损害LCP
  • mobile-friendly:移动优先索引;内容一致性
  • tab-accordion:加载时内容已存在于DOM;服务端渲染标签页
  • carousel:内容存在于初始HTML;服务端渲染轮播图
  • hero-generator:Hero区内容存在于初始HTML;避免仅用JS渲染
  • navigation-menu-generator:导航栏在首屏渲染;不要仅用JS渲染菜单