Skip to content

fix(cache): classify explicit io probes - #3097

Open
james-elicx wants to merge 4 commits into
codex/cacheability-unstable-cache-upgradefrom
codex/cacheability-platform-io
Open

fix(cache): classify explicit io probes#3097
james-elicx wants to merge 4 commits into
codex/cacheability-unstable-cache-upgradefrom
codex/cacheability-platform-io

Conversation

@james-elicx

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

Copy link
Copy Markdown
Member

Follow-up stack 2/2. Exact head: 4311d92858fb18d6356fbd16b6de8bde0a14ab98. Base: #3099 at 7ab2b603d.

Chain: #3099#3097.

This layer closes the explicit io() ownership and post-certification admission gap for Cache Components:

  • during a staged Cache Components prerender, io() notifies the outer render owner before returning its hanging promise, so a surrounding Suspense fallback cannot complete and be certified as static
  • io() remains a no-op inside "use cache" and unstable_cache() scopes, matching Next.js even though vinext models those owners in separate async-local state
  • legacy prerendering without Cache Components remains eligible; io() does not demote those routes
  • hybrid Pages Router fallbacks run with legacy prerender ownership and clear the App Cache Components marker, matching Next.js where io() is a no-op in Pages GSSP, GSP, and component rendering
  • the request records whether Cache Components are enabled, allowing a manifest-certified route that later takes an io() branch after an edge purge to fail closed before public CDN policy is restored

The built-workerd regression covers both sides of the lifecycle: authenticated probing classifies direct App io() as dynamic while proving a hybrid Pages React.use(io()) render completes, and a route certified through its static branch remains private when later application state selects io() after the warmed edge object is purged. A second request proves the private refill did not re-warm the edge.

This PR deliberately does not instrument Date, Math, Web Crypto, or Node crypto. Platform-I/O parity is separate from the request-derived cache disclosure fix and requires a design that does not rewrite node:crypto imports.

Next.js references:

Review size

Layer-only diff against #3099: 20 files, +425/-23.

Validation

  • focused cache/admission/runtime tests — 1,551/1,551
  • Cache Components built-workerd E2E — 2/2
  • vp check
  • git diff --check
@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 4311d92

@github-actions

github-actions Bot commented Aug 26, 2026

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
static-export preview production
web preview production
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 4311d92 against base 7ab2b60 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.3 KB 142.3 KB ⚫ +0.0%
Client entry size (gzip) vinext 129.5 KB 129.5 KB ⚫ +0.0%
Dev server cold start vinext 3.04 s 3.03 s ⚫ -0.3%
Production build time vinext 3.27 s 3.28 s ⚫ +0.2%
RSC entry closure size (gzip) vinext 119.0 KB 119.1 KB ⚫ +0.1%
Server bundle size (gzip) vinext 202.4 KB 202.4 KB ⚫ +0.0%

View detailed results and traces

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

@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch from afde0d2 to eebc6e4 Compare August 26, 2026 15:14
@james-elicx james-elicx changed the title fix(cache): classify Cache Components platform I/O probes Aug 26, 2026
@james-elicx
james-elicx changed the base branch from codex/cacheability-use-cache-ownership to codex/cacheability-fill-publication August 26, 2026 15:41
@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch from eebc6e4 to 3ba0ec6 Compare August 26, 2026 18:01
@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch 2 times, most recently from 72a2e52 to 6d73915 Compare August 26, 2026 18:31
@james-elicx
james-elicx changed the base branch from codex/cacheability-fill-publication to codex/cacheability-unstable-cache-upgrade August 26, 2026 18:31
@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch from 6d73915 to c482584 Compare August 26, 2026 19:33
@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch from c482584 to cec612c Compare August 26, 2026 19:42
@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch 2 times, most recently from a90a838 to 8df02a7 Compare August 27, 2026 02:40
@james-elicx
james-elicx force-pushed the codex/cacheability-platform-io branch from 8df02a7 to 4311d92 Compare August 27, 2026 02:43
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk

ask-bonk Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@james-elicx Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@james-elicx
james-elicx marked this pull request as ready for review August 27, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant