SPA vs SSR vs SSG vs ISR vs RSC streaming — где и когда мы превращаем данные в HTML. Build-time → CDN edge → origin Node → client browser. Trade-offs: TTFB, SEO, dynamic data freshness, infra cost. 5 сценариев: SPA blank-then-fill, SSR per-request render + hydrate, SSG/ISR pre-built на CDN, RSC streaming через Edge с Suspense, anti-pattern (SPA для marketing landing). 2 ADR: дефолтный выбор в 2026 (Next.js App Router + RSC) и правило близости рендеринга к user.
CSR, SSR и static rendering описывают место и момент получения начального HTML, а не три взаимоисключающих типа продукта. Один сайт может предварительно сгенерировать документацию, рендерить персональную страницу на запросе и после загрузки выполнять клиентские переходы.
SSR или prerendering не отменяют JavaScript автоматически: интерактивный UI может гидратироваться и занять main thread. Поэтому решение принимают по freshness, personalization, cacheability, resilience и client-work budget каждого маршрута.
| Компонент | Роль в модели |
|---|---|
| Browser Navigation | navigation and assets; execute interactive code; sampled field metrics |
| Edge Cache and Route Policy | navigation and assets; static miss; dynamic miss |
| Versioned Static Output | static miss |
| Request-time Renderer | dynamic miss; request-scoped data |
| Authorized Data API | request-scoped data; client data request |
| Client Runtime and Hydration | execute interactive code; client data request |
| Real-user Telemetry | sampled field metrics |
A versioned documentation route is generated before traffic and served through the edge. A miss reads immutable output; the response can be shared because it has no user-specific state.
Проверяемый исход: The cache key names a deploy version, invalidation is explicit, and origin availability is not required for an edge hit.
An authenticated dashboard bypasses shared HTML caching. The request-time renderer fetches authorized data and returns private HTML with a request-scoped initial snapshot.
Проверяемый исход: No other user can receive the personalized response, and downstream deadlines bound request-time fan-out.
The browser receives server-created HTML, then the client runtime attaches interaction using the same serialized initial version. Later server data remains server-owned and is revalidated explicitly.
Проверяемый исход: The first client snapshot matches the HTML, event handlers become active, and stale server data is not silently promoted to durable client truth.
Field telemetry separates TTFB, content rendering and interaction delay. The team changes one route only after comparing cache hit rate, transferred JavaScript and main-thread work by device class.
Проверяемый исход: The rendering decision is based on measured distributions and correctness constraints rather than a universal SPA-versus-SSR slogan.
origin_render_rps = navigation_rps × (1 − safe_cache_hit_ratio) for the measured route and cache policy.build_time ≈ generated_routes × mean_render_seconds / effective_parallelism; validate memory and API quotas before assuming linear parallel speed-up.client_cost = transfer_bytes + parse_compile_work + execute_render_work; bytes and CPU use different units and must not be added into one synthetic number.Числа и bounds выше действуют только при названных units, population и assumptions. Ни паттерн, ни browser API сами по себе не задают SLA, capacity или correctness.
Диаграмма показывает delivery и hydration boundaries. Она не моделирует конкретный framework, React Server Components, edge vendor или поисковый ranking algorithm и не обещает performance автоматически.
Введите числа или выберите пресет