Skip to content

fix(cache): bypass shared lookup for force-dynamic routes - #3346

Merged
james-elicx merged 9 commits into
mainfrom
codex/force-dynamic-cache-bypass
Sep 21, 2026
Merged

james-elicx merged 9 commits into
mainfrom
codex/force-dynamic-cache-bypass

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Summary

  • classify explicit force-dynamic App pages, inherited layouts, parallel branches, and Route Handlers in the build-time request manifest
  • route those requests around the shared response cache while preserving explicit public next.config cache policies
  • add a Response Store demo route, a zero-store-invocation regression, and deployed coverage for Response Store, Workers Cache, and KV

Testing

  • vp check
  • vp test run tests/app-page-dispatch.test.ts tests/app-route-handler-policy.test.ts tests/app-rsc-handler.test.ts tests/app-worker-stages.test.ts tests/entry-templates.test.ts
  • vp run @vinext/cloudflare#test

@pkg-pr-new

pkg-pr-new Bot commented Sep 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

npm i https://pkg.pr.new/@vinext/cloudflare@3346

create-vinext-app

npm i https://pkg.pr.new/create-vinext-app@3346

@vinext/types

npm i https://pkg.pr.new/@vinext/types@3346

vinext

npm i https://pkg.pr.new/vinext@3346

@cloudflare/workers-response-store

npm i https://pkg.pr.new/@cloudflare/workers-response-store@3346

commit: 5d8661c

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 5d8661c against base 94c5adc 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.7 KB 129.7 KB ⚫ +0.0%
Dev server cold start vinext 3.33 s 3.30 s ⚫ -1.0%
Production build time vinext 3.89 s 3.86 s ⚫ -0.8%
RSC entry closure size (gzip) vinext 127.5 KB 127.5 KB ⚫ +0.0%
Server bundle size (gzip) vinext 225.5 KB 225.6 KB ⚫ +0.0%

View detailed results and traces

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

@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
response-store-demo preview production
workers-cache preview production
kv preview production
static-export preview production
web preview production

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

: [
...route.layouts,
route.pagePath,
...route.parallelSlots.flatMap((slot) => [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Include intercepting branches in force-dynamic classification\n\nThis scans the normal page/layout and parallel-slot branches, but it never scans route.siblingIntercepts or each slot’s interceptingRoutes (pagePath plus layoutPaths). If the canonical /photos/[id] page is static while an intercepting modal for that route exports dynamic = "force-dynamic", the generated route remains forceDynamic: false; an intercepted request therefore still consults the shared Response Store/Workers Cache before the runtime segment config can veto admission. Please classify the intercept branch as well (conservatively at route level, or carry branch-specific metadata) and cover that case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5d8661c. The build-time classifier now includes each slot intercept and sibling intercept page plus its layout chain, with regression coverage for both shapes. This follows Next.js applying segment dynamic config while recursively constructing the selected branch: https://github.com/vercel/next.js/blob/c20c1d4125b5a3548207a17619837ae590fc187b/packages/next/src/server/app-render/create-component-tree.tsx#L303-L338

@ask-bonk

ask-bonk Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Posted 1 actionable inline finding.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

@ask-bonk

ask-bonk Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@james-elicx
james-elicx marked this pull request as ready for review September 21, 2026 14:27
@james-elicx
james-elicx merged commit f0a2806 into main Sep 21, 2026
82 checks passed
@james-elicx
james-elicx deleted the codex/force-dynamic-cache-bypass branch September 21, 2026 14:27
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