Skip to content

docs: platform portability and infrastructure documentation#91237

Merged
ijjk merged 29 commits intocanaryfrom
jimmylai/docs-platform-portability
Mar 23, 2026
Merged

docs: platform portability and infrastructure documentation#91237
ijjk merged 29 commits intocanaryfrom
jimmylai/docs-platform-portability

Conversation

@feedthejim
Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive documentation addressing platform partner feedback about Next.js portability, infrastructure requirements, and CDN caching. All technical claims verified against the codebase.

New pages (5):

  • Rendering Philosophy — explains Next.js's component-level static/dynamic spectrum, framework comparisons, functional vs. performance fidelity definitions, CDN compatibility
  • Deploying to Platforms — feature support matrix (streaming/cache/edge requirements per feature), CDN infrastructure table, minimum requirements, adapter guidance
  • How Revalidation Works — tag system architecture (explicit + soft tags with _N_T_ prefix), HTML/RSC consistency requirements, multi-instance coordination, graceful degradation
  • CDN Caching — cache variability (Vary headers, _rsc param), graceful degradation when headers are dropped, static prefetch caching (PPR-scoped), pathname-based cache keying direction
  • PPR Platform Guide — implementation tiers (origin-only through edge), resume protocol (next-resume header, POST + body), artifact storage, implementation checklist

Expanded pages (4):

  • Self-Hosting — streaming infrastructure requirements, multi-instance cache coordination, CDN guide links, graceful shutdown details
  • ISR — multi-instance caveats, tag propagation, background regeneration billing, x-nextjs-cache monitoring
  • Cache Handlers — distributed tag coordination (Redis example), soft tags explanation, stream handling, error handling patterns
  • Adapter API — runtime integration context, PPR chain headers (next-resume), multi-instance cache entry propagation, fixed stale x-nextjs-resume comment

Key corrections from code verification

  • Resume header is next-resume, not x-nextjs-resume (fixed in existing adapterPath docs too)
  • Resume requires POST with postponed state in body, not just a header
  • x-nextjs-cache has 4 values including REVALIDATED, only emitted outside minimal mode
  • Soft tags use _N_T_ prefix with layout paths (_N_T_/blog/layout), not bare paths
  • stale-while-revalidate in Cache-Control is conditional on expire config
  • Static prefetch caching without state tree only works for PPR-enabled routes
  • Fastly product renamed from Compute@Edge to Compute

Test plan

  • Verify all 9 pages render correctly on docs site
  • Verify all internal cross-references resolve
  • Verify tables render correctly in MDX
  • Review framework comparison claims with team
  • Review CDN compatibility table accuracy

New pages:
- Rendering Philosophy: component-level static/dynamic spectrum, fidelity definitions
- Deploying to Platforms: feature support matrix, CDN compatibility, minimum requirements
- How Revalidation Works: tag architecture, cache consistency, multi-instance coordination
- CDN Caching: cache variability, graceful degradation, pathname-based direction
- PPR Platform Guide: implementation tiers, resume protocol, artifact storage

Expanded pages:
- Self-Hosting: streaming infrastructure, multi-instance cache coordination
- ISR: multi-instance caveats, tag propagation, x-nextjs-cache monitoring
- Cache Handlers: distributed tags, soft tags, stream handling, error patterns
- Adapter API: runtime integration, PPR chain headers, cache entry propagation

All technical claims verified against the codebase including corrected
header names (next-resume, not x-nextjs-resume), resume protocol
(POST + body), and tag generation (\_N\_T\_ prefix with layout paths).
@nextjs-bot nextjs-bot added created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation. labels Mar 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

All broken links are now fixed, thank you!

- Fix prerenders access pattern: array iteration, not dict indexing
- Scope _rsc validation to experimental.validateRSCRequestHeaders flag
- Fix "single render pass" to "same React component tree"
- Fix get() error handling: handlers must catch errors, not framework
- Fix waitUntil location: ctx.waitUntil, not requestMeta.waitUntil
- Fix onCacheEntryV2 description: fires on lookup too, not just updates
Rendering Philosophy:
- Remove defensive "not accidental complexity" phrasing
- Reframe infrastructure requirements as trade-off, not hierarchy
- Fix Remix characterization (acknowledge React Router v7, deliberate SSR stance)
- Remove Astro name-drop from server islands description
- Add governance language to adapter test suite ("open to contributions")
- Change "no architectural blockers" to "primitives to build support"
- Fix "developers don't need to predict" overclaim

Deploying to Platforms:
- Move fidelity definitions before feature matrix (interpretive frame first)
- Clarify "Recommended" vs "Required" in matrix footnotes
- CDN table: "primitives to build" not "primitives needed for"
- Acknowledge table shows primitives, not finished integrations
- Rewrite framework comparisons to use trade-off language

CDN Caching:
- Restructure to lead with wins (Cache-Control, static assets, prefetches)
- Move cache variability problem after what works
- Split graceful degradation into "safely drop" vs "must preserve"
- Pair Vary limitation with _rsc workaround + pathname direction
- Fix "cache poisoning" mention with context and resolution

Revalidation:
- Remove "deliberate design choice" self-justification
- Lead graceful degradation with design principle, not failure list
- Add recovery path framing ("every failure mode has a defined recovery")

PPR Platform Guide:
- Tighten postponedState guidance ("must" not "should")

Self-Hosting:
- PPR streaming: "required" not "optimal experience"
PPR Platform Guide:
- Distinguish CDN-to-origin (HTTP POST) from adapter-based (direct
  function invocation) resume paths
- Explain minimal mode activation (NEXT_PRIVATE_MINIMAL_MODE)
- Add hybrid architecture note: edge shell + Node.js resume is valid
  for routes using runtime: 'nodejs'

Revalidation:
- Add refreshTags() failure handling guidance: catch errors, continue
  with local tag state, serve temporarily stale content
- Clarify atomic writes are not required for correctness
- CDN Cache-Control: clarify that on-demand revalidation does NOT
  propagate to CDN cache without explicit purge logic
- Minimum requirements: Node.js server (not streaming specifically),
  streaming is needed for progressive delivery but features work without
- HTML/RSC mismatch: remove incorrect claim about client-side detection,
  mismatch causes data inconsistency not auto-recovery unless
  deploymentId is configured
- Multi-instance: worst case is data inconsistency across instances,
  not full page reload
Tested 19 header combinations against a real Next.js app:
- Add next-router-prefetch to "safely drop" list (verified identical
  responses for static/ISR)
- Add rsc header to "must preserve" list with explanation of why
  stripping it breaks client-side navigation
- Clarify _rsc enforcement: server responds with 307 redirect when
  _rsc is missing or wrong, not just silent misbehavior
- Remove stale-while-revalidate conditional framing for state-tree
  (static/ISR responses are byte-identical with or without it)
- Rename "Graceful Degradation" to "Handling Headers at the CDN" to
  avoid contradiction of having "must preserve" under "degradation"
- Merge two back-to-back "Good to know" callouts into one
- Add next-router-segment-prefetch to "safely drop" list (was in Vary
  list but missing from both safely-drop and must-preserve)
- Replace "cache-busting mechanism" with "cache-key discriminator"
  (_rsc differentiates variants, not busts cache)
- Expand RSC on first use: "React Server Components (RSC)"
- Fix tense consistency in interception routes direction section
- Consolidate "What this means for CDNs" into "How it works" to
  remove redundant three-point list
- Add CDN query-param stripping warning for _rsc
Rendering Philosophy:
- Fix missing comma creating run-on sentence in Remix description
- Consistent use-cache links (both point to directive API reference)
- Expand RSC on first use in cache consistency bullet
- Align streaming requirement with deploying page (Node.js minimum,
  streaming for progressive delivery)
- Remove repeated "real" in adjacent sections

Deploying to Platforms:
- CDN table intro: "available building blocks, not finished integrations"
- Remove redundant footnote (qualifier now in intro)
- Tighten closing sentence in framework comparisons

How Revalidation Works:
- Split mismatch section into two paragraphs for scannability
- Unify terminology: "version skew" used consistently
- Fix "without shared cache" appearing under "with shared cache" heading
- Strengthen refreshTags error handling from suggestion to requirement
- Simplify getExpiration description (remove Infinity, link to API ref)

PPR Platform Guide:
- Fix double "opaque" in postponedState description
- Clarify dual mechanism (POST body preferred, requestMeta.postponed
  as equivalent in-process alternative)
- Move Storing PPR Artifacts before Edge Compute (prerequisite knowledge)
- Expand Edge Compute: hybrid vs full-edge architecture, KV storage
- Update checklist step 3 to cover both CDN and adapter paths

Edited Pages:
- ISR: merge two related caveats into one bullet
- cacheHandlers: rename "Understanding Soft Tags" to "Soft Tags"
… consistency

- Resume protocol works in both minimal and standard mode (app-page.ts template has no minimalMode gate)
- Separate within-deployment HTML/RSC cache inconsistency from cross-deployment skew (deploymentId)
Don't imply all adapter-based deployments use minimal mode.
… guide

Edge compute section is about where platforms serve the shell, not about
Next.js runtime: 'edge' configuration. Remove runtime references.
- Fix addRequestMeta reference (internal API, not adapter-facing)
- Soften CDN concurrency claim ("ideally in parallel" not "simultaneously")
- Use "concatenates" instead of "stitches" for streaming response
- Document x-next-resume-state-length for combined Server Action + PPR resume
- Move "Storing PPR Artifacts" before implementation levels (prerequisite)
- Promote "Resume Protocol" to top-level section (applies to CDN and adapter)
- Fold Edge Compute into CDN section as a brief note
- Move adapter output details into resume protocol section (actionable context)
- Remove client-side implementation details (script tags, self.__next_f)
- Remove filler (TTFB depends on origin latency)
- Fix "stitching" terminology inconsistency
- Akamai: "KV" → "EdgeKV" (official product name)
- Fastly: "KV" → "KV Store" (official product name)
- ALB: clarify buffering is with Lambda integration, not HTTP mode
Replace named framework comparisons with architectural pattern
descriptions. The point is to explain the trade-off Next.js makes
(component-level vs route-level boundaries), not to categorize
competitors.
Describe three levels of static/dynamic boundary (build-time, route-level,
component-level) with their trade-offs, without naming specific frameworks.
Most community adapters deploy as a Node.js server without leveraging
CDN primitives. The primitives exist but aren't used yet.
…ides

The adapter API is documented and live. Replace the "we are working on"
note with links to the actual adapter docs and the new
deploying-to-platforms guide.
- ISR: shorten multi-instance bullet, link to how-revalidation-works
- streaming: add rendering-philosophy to related links
@ijjk ijjk marked this pull request as ready for review March 23, 2026 18:39
Copy link
Copy Markdown
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to land these at this point and we can continue iterating on them in follow-ups!

@ijjk ijjk merged commit eb44c31 into canary Mar 23, 2026
74 checks passed
@ijjk ijjk deleted the jimmylai/docs-platform-portability branch March 23, 2026 19:09
icyJoseph pushed a commit that referenced this pull request Mar 25, 2026
## Summary

Adds comprehensive documentation addressing platform partner feedback
about Next.js portability, infrastructure requirements, and CDN caching.
All technical claims verified against the codebase.

**New pages (5):**
- **Rendering Philosophy** — explains Next.js's component-level
static/dynamic spectrum, framework comparisons, functional vs.
performance fidelity definitions, CDN compatibility
- **Deploying to Platforms** — feature support matrix
(streaming/cache/edge requirements per feature), CDN infrastructure
table, minimum requirements, adapter guidance
- **How Revalidation Works** — tag system architecture (explicit + soft
tags with `_N_T_` prefix), HTML/RSC consistency requirements,
multi-instance coordination, graceful degradation
- **CDN Caching** — cache variability (`Vary` headers, `_rsc` param),
graceful degradation when headers are dropped, static prefetch caching
(PPR-scoped), pathname-based cache keying direction
- **PPR Platform Guide** — implementation tiers (origin-only through
edge), resume protocol (`next-resume` header, POST + body), artifact
storage, implementation checklist

**Expanded pages (4):**
- **Self-Hosting** — streaming infrastructure requirements,
multi-instance cache coordination, CDN guide links, graceful shutdown
details
- **ISR** — multi-instance caveats, tag propagation, background
regeneration billing, `x-nextjs-cache` monitoring
- **Cache Handlers** — distributed tag coordination (Redis example),
soft tags explanation, stream handling, error handling patterns
- **Adapter API** — runtime integration context, PPR chain headers
(`next-resume`), multi-instance cache entry propagation, fixed stale
`x-nextjs-resume` comment

## Key corrections from code verification
- Resume header is `next-resume`, not `x-nextjs-resume` (fixed in
existing adapterPath docs too)
- Resume requires POST with postponed state in body, not just a header
- `x-nextjs-cache` has 4 values including `REVALIDATED`, only emitted
outside minimal mode
- Soft tags use `_N_T_` prefix with layout paths (`_N_T_/blog/layout`),
not bare paths
- `stale-while-revalidate` in Cache-Control is conditional on `expire`
config
- Static prefetch caching without state tree only works for PPR-enabled
routes
- Fastly product renamed from `Compute@Edge` to `Compute`

---------

Co-authored-by: JJ Kasper <[email protected]>
Co-authored-by: Tim Neutkens <[email protected]>
feedthejim added a commit that referenced this pull request Mar 26, 2026
Backporting

1. `0e598d2131` — docs: use ErrorInfo type consistently in catchError
docs (#91744)
2. `70760c201b` — docs: add catchError benefits over userspace error
boundaries (#91745)
3. `1f920cd057` — docs: platform portability and infrastructure
documentation (#91237)
4. `5d2b57b051` — docs: add verified adapters section (#91849)

---------

Co-authored-by: Jiwon Choi <[email protected]>
Co-authored-by: Jimmy Lai <[email protected]>
Co-authored-by: JJ Kasper <[email protected]>
Co-authored-by: Tim Neutkens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants