Skip to main content

implement-server-side-rendering

Implement server-side rendering with deterministic hydration, correct status and metadata, safe caching, and observable failure behavior. Use when routes need useful first responses for users, crawlers, sharing, or performance.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
3
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
implement-server-side-rendering
category
web
description
Implement server-side rendering with deterministic hydration, correct status and metadata, safe caching, and observable failure behavior. Use when routes need useful first responses for users, crawlers, sharing, or performance.
# implement-server-side-rendering Make the server response a complete, truthful representation of route state. ## When to use - Use for public content, commerce, authenticated application shells, or routes harmed by client-only startup. - Avoid SSR when static generation or a simpler server-rendered page meets the need. ## Procedure 1. Classify routes by public, personalized, authenticated, static, dynamic, cacheable, streaming, and mutation behavior. 2. Define server data dependencies, timeouts, authorization, locale, experiment, device, and error boundaries. 3. Render valid content, landmarks, links, forms, title, canonical, metadata, and the correct HTTP status in the initial response. 4. Serialize only the minimum hydration state with safe escaping; never expose secrets or data from another user or tenant. 5. Make server and client output deterministic across clocks, random values, identifiers, locale, browser-only APIs, and feature flags. 6. Hydrate without replacing focus, user input, or server-visible content. Detect and fail tests on mismatches. 7. Set cache keys and private/public directives from every representation-changing input. Keep authenticated data out of shared caches. 8. Design loading, streaming, timeout, not-found, redirect, and dependency failure behavior with correct status semantics. 9. Instrument server time, data time, render time, hydration errors, route failures, cache behavior, and client recovery. 10. Test view source, JavaScript disabled, slow and failed dependencies, authenticated isolation, locale, bots, navigation, forms, and deploy-version skew. ## Failure plan - If SSR fails, return a controlled error or safe shell with truthful status rather than another user's cached content. - If server and client versions differ, preserve compatible serialized state or hold rollout until parity is restored. ## Done - An SSR route matrix records data, auth, metadata, status, cache, streaming, and hydration decisions - Tests prove deterministic output, user and tenant isolation, correct statuses, no-JavaScript usefulness, and client recovery - Runtime evidence reports performance, cache behavior, hydration mismatches, dependency failures, and safe rollback
在 GitHub 查看