mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #617] [CLOSED] fix: skip ISR cache write for RSC requests when dynamic APIs are used #718
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#718
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/617
Author: @NathanDrake2406
Created: 3/21/2026
Status: ❌ Closed
Base:
main← Head:fix/rsc-dynamic-usage-cache-bypass📝 Commits (4)
126fd47test: add ISR + searchParams dynamic usage regression testsb714e5dfix: skip ISR cache write for RSC requests when dynamic APIs are used899af8efix: add deferred dynamic usage check for APIs called during RSC renderingcb63a66test: update entry template snapshots for dynamic usage guard📊 Changes
4 files changed (+200 additions, -14 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+17 -2)📝
tests/__snapshots__/entry-templates.test.ts.snap(+102 -12)📝
tests/app-router.test.ts(+60 -0)➕
tests/fixtures/app-basic/app/isr-dynamic-search/page.tsx(+21 -0)📄 Description
Summary
searchParams,headers(),cookies(),noStore()). The HTML path correctly checkedconsumeDynamicUsage()before caching, but the RSC path returned before that check ever ran.revalidateand dynamic APIs (likesearchParamsorheaders()) served stale cached data on client-side navigations — the first request's content was cached under the pathname key and returned for all subsequent RSC requests regardless of different search params.consumeDynamicUsage()catches APIs called during element construction (searchParams), deferred check inside the cache write promise catches APIs called during stream rendering (headers, cookies, noStore).Closes #588
Test plan
isr-dynamic-search) withrevalidate=60+searchParamsaccessX-Vinext-CacheheaderconsumeDynamicUsage()guards existapp-router.test.tstests passgenerateRscEntryISR code generation tests passfeatures.test.tsISR tests passpnpm run checkcleanheaders()+noStore()+revalidate=604800) viawrangler dev🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.