Skip to content

fix(isr): ignore interception context on HTML renders - #2915

Open
JamesbbBriz wants to merge 2 commits into
cloudflare:mainfrom
JamesbbBriz:codex/fix-isr-interception-context-cache-key
Open

fix(isr): ignore interception context on HTML renders#2915
JamesbbBriz wants to merge 2 commits into
cloudflare:mainfrom
JamesbbBriz:codex/fix-isr-interception-context-cache-key

Conversation

@JamesbbBriz

@JamesbbBriz JamesbbBriz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ignore client-supplied interception context when dispatching plain HTML page renders
  • preserve interception context for legitimate RSC navigation and Server Action requests
  • lock the real cache-write contract for both fresh HTML capture and stale background regeneration: RSC data lands on rsc:/photos/123:none:none, never a forged intercepted variant
  • add a regression test matching Next.js hard-refresh behavior for interception routes

Closes #2780

Tests

  • vp test run tests/app-rsc-handler.test.ts tests/app-page-dispatch.test.ts tests/isr-cache.test.ts tests/fetch-cache.test.ts tests/kv-cache-handler.test.ts — 524 passed
  • focused fresh/stale cache-key regressions — 2 passed
  • vp check on all changed files
  • git diff --check

The existing Server Action regression also verifies that legitimate actions retain the raw interception source before the HTML-only dispatch gate.

@JamesbbBriz

Copy link
Copy Markdown
Contributor Author

/bigbonk

@pkg-pr-new

pkg-pr-new Bot commented Aug 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 070bfb0

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 070bfb0 against base a3d1d1d 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 135.4 KB 135.4 KB ⚫ -0.0%
Client entry size (gzip) vinext 122.8 KB 122.8 KB ⚫ -0.0%
Dev server cold start vinext 2.88 s 2.86 s ⚫ -0.9%
Production build time vinext 2.99 s 3.00 s ⚫ +0.4%
RSC entry closure size (gzip) vinext 114.6 KB 114.6 KB ⚫ +0.0%
Server bundle size (gzip) vinext 194.8 KB 194.8 KB ⚫ +0.0%

View detailed results and traces

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

@JamesbbBriz

Copy link
Copy Markdown
Contributor Author

/bigbonk

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.

Client-supplied X-Vinext-Interception-Context is folded into the RSC ISR cache key on HTML renders, where interception is disabled

1 participant