Skip to content

fix(cache): preserve prerender metadata across completion races - #3108

Open
james-elicx wants to merge 2 commits into
mainfrom
codex/fix-prerender-stale-time-race
Open

fix(cache): preserve prerender metadata across completion races#3108
james-elicx wants to merge 2 commits into
mainfrom
codex/fix-prerender-stale-time-race

Conversation

@james-elicx

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

Copy link
Copy Markdown
Member

Capability stack 1/9. Exact head: 1fd53d7b899a4e34cb0dbf49b99168936a942b6a. Base: main.

Full chain: #3108#3090#3091#3092#3103#3093#3094#3098#3113.

Summary

This keeps two independent completion-ordering fixes outside the cacheability implementation layers:

  • drain the single-chunk stream-test transform before releasing its reader, preventing Node 24.20 cancellation from racing asynchronous flush()
  • preserve prerender cache-life metadata when the HTML navigation footer finalizes before the outer render lifecycle consumes that metadata
  • add a deterministic regression for the prerender ordering

Without the stale-time fix, prerendered HTML can omit staleTimeSeconds even though the prerender manifest records the correct value.

No staged probing, cacheability manifest, CDN-admission behavior, or warming behavior is introduced here. #3090 begins the capability itself.

Review size

Layer-only diff against this PR's base: 3 files, +83/-8.

Validation

  • layer exact-head CI is green
  • prior cumulative focused validation through feat(cache): probe Pages Router cacheability #30982,024/2,024
  • current full-stack cumulative changed-file suites — 2,864/2,864
  • current full-stack PPR probe/admission/Pages built-workerd E2E — 8/8
  • current full-stack vp check and 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@3108
npm i https://pkg.pr.new/create-vinext-app@3108
npm i https://pkg.pr.new/@vinext/types@3108
npm i https://pkg.pr.new/vinext@3108

commit: 1fd53d7

@james-elicx
james-elicx force-pushed the codex/fix-prerender-stale-time-race branch from d0c7267 to 9cc60c2 Compare August 26, 2026 19:42
@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
@james-elicx
james-elicx changed the base branch from main to codex/fix-node-24-stream-test-drain August 26, 2026 19:42
@james-elicx james-elicx changed the title fix(cache): preserve prerender stale metadata across footer race Aug 26, 2026
@james-elicx
james-elicx changed the base branch from codex/fix-node-24-stream-test-drain to main August 26, 2026 19:45
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 1fd53d7 against base c1a78a7 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.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 3.14 s 3.13 s ⚫ -0.4%
Production build time vinext 3.56 s 3.54 s ⚫ -0.6%
RSC entry closure size (gzip) vinext 116.6 KB 116.6 KB ⚫ 0.0%
Server bundle size (gzip) vinext 198.1 KB 198.1 KB ⚫ -0.0%

View detailed results and traces

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant