Skip to content

fix(cloudflare): harden canonical RSC warmup end to end - #3040

Open
james-elicx wants to merge 21 commits into
codex/rsc-prewarm-e2e-prooffrom
codex/rsc-prewarm-discovery-fail-closed
Open

fix(cloudflare): harden canonical RSC warmup end to end#3040
james-elicx wants to merge 21 commits into
codex/rsc-prewarm-e2e-prooffrom
codex/rsc-prewarm-discovery-fail-closed

Conversation

@james-elicx

@james-elicx james-elicx commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

Consolidates the canonical warmup hardening previously split across #3021#3040. This range ends at the first clean, self-contained deployed boundary: earlier heads could begin filling cache keys while version-override routing was still mixed, which is fixed by the staged-readiness work included here.

Response and build validation

  • validate effective Cloudflare cache policy, shared freshness, cache admission status, cookies, content type, exact supported Vary, and immutable build identity
  • expose generic adapter-owned build identity at the outer App and Pages response boundary
  • retry only failed staged requests after the initial queue and distinguish transient old-build responses from permanent same-build failures
  • keep strict and best-effort warming bound to the uploaded Worker build

Canonical request ownership

  • align concrete App/Pages and hybrid-i18n ownership between browser navigation, runtime routing, and warm discovery
  • keep rewrite-affected, parallel/interception-only, and other contextual requests hashed rather than collapsing them into canonical entries
  • prove Link, router.prefetch(), router.push(), explicit full prefetch, and soft navigation reuse on a real deployed Worker
  • isolate each deployed proof attempt behind a fresh Worker/cache namespace

Discovery and staged deployment

  • discover child routes using parent-generated params and exclude rewrite/redirect-owned public paths
  • discover localized Pages keys with basePath and trailingSlash applied correctly
  • warm the concrete production route/custom domain reported by Wrangler without changing TPR parsing
  • derive version identity from upload output and fail closed when deployment state is unavailable
  • establish stable uploaded-version readiness with unique no-cache probes before sending any canonical cache-fill request
  • enforce strict/no-promote staging invariants, configured retry budgets, and complete fail-closed discovery

The three findings raised on #3038 are resolved by #3039 and #3040 within this consolidated range.

Scope

Only canonical RSC/ISR CDN warm request identity, build-time warm discovery, response validation, and Cloudflare staged deployment. No middleware, TPR, development-mode, cross-version-cache, local page rendering, or generic caching changes.

Validation

The retained commits keep their focused client, ownership, cache, adapter, discovery, deploy, version, build, and deployed Playwright coverage. This exact head passed all 67 checks, including strict Worker prewarming and browser reuse.

Consolidates #3021 through #3040. Stacked on #3020.

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
workers-cache preview production
web preview production

@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@3040
npm i https://pkg.pr.new/create-vinext-app@3040
npm i https://pkg.pr.new/@vinext/types@3040
npm i https://pkg.pr.new/vinext@3040

commit: 22c8e57

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 22c8e57 against base 6162f02 using alternating same-runner rounds. Next.js was unchanged and skipped.

1 improved · 0 regressed · 5 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.2 KB 142.2 KB ⚫ +0.0%
Client entry size (gzip) vinext 129.5 KB 129.5 KB ⚫ +0.0%
Dev server cold start vinext 2.22 s 2.18 s 🟢 -1.8%
Production build time vinext 2.31 s 2.34 s ⚫ +1.4%
RSC entry closure size (gzip) vinext 116.0 KB 116.0 KB ⚫ -0.0%
Server bundle size (gzip) vinext 197.5 KB 197.5 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@james-elicx james-elicx changed the title fix(build): fail closed during CDN warm path discovery fix(cloudflare): harden warm discovery and staged deployment Aug 22, 2026
@james-elicx
james-elicx changed the base branch from codex/rsc-prewarm-deploy-invariants to codex/rsc-prewarm-loading-shell-scope August 22, 2026 16:58
@james-elicx james-elicx changed the title fix(cloudflare): harden warm discovery and staged deployment fix(cloudflare): harden canonical RSC warmup end to end Aug 22, 2026
@james-elicx
james-elicx changed the base branch from codex/rsc-prewarm-loading-shell-scope to codex/rsc-prewarm-e2e-proof August 22, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant