feat(cache): classify and warm static Route Handlers - #3113
Open
james-elicx wants to merge 9 commits into
Open
Conversation
commit: |
This was referenced Aug 27, 2026
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
james-elicx
force-pushed
the
codex/cacheability-route-handlers
branch
from
August 27, 2026 00:50
4d106e8 to
8bd2cbe
Compare
Contributor
|
james-elicx
force-pushed
the
codex/cacheability-route-handlers
branch
2 times, most recently
from
August 27, 2026 00:58
c5c2079 to
e77095a
Compare
james-elicx
force-pushed
the
codex/cacheability-route-handlers
branch
2 times, most recently
from
August 27, 2026 01:24
c8d2632 to
52db9f5
Compare
james-elicx
force-pushed
the
codex/cacheability-route-handlers
branch
from
August 27, 2026 01:41
52db9f5 to
796082a
Compare
Member
Author
|
/bigbonk review for issues |
james-elicx
force-pushed
the
codex/cacheability-route-handlers
branch
from
August 27, 2026 01:50
796082a to
1246114
Compare
Member
Author
|
/bigbonk review for issues |
Contributor
|
@james-elicx Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
Member
Author
|
/bigbonk review for issues |
Member
Author
|
/bigbonk review for issues |
Member
Author
|
/bigbonk review for issues |
james-elicx
marked this pull request as ready for review
August 27, 2026 08:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capability stack 9/9. Exact head:
85ab9571f5ac14604bb5d4d4f67b14983a1fba8f. Base: #3098.Full chain: #3108 → #3090 → #3091 → #3092 → #3103 → #3093 → #3094 → #3098 → #3113.
This is the cumulative capability head. It completes two-stage cacheability probing, embedded-manifest admission, and final CDN warming for statically eligible App Router Route Handlers.
What this adds
dynamic = "force-static",dynamic = "error", positive orfalserevalidate, and dynamic routes withgenerateStaticParamsgenerateStaticParamsduring staged Worker discovery and produce concrete request identitiesAccept: */*) for probing, readiness, and final warmingrevalidatepolicy alone cannot bypass manifest absenceGETandgenerateStaticParamsexports, using exported names rather than local bindingsexport *declarations without adding a module-graph walk; type-only export stars remain harmlessSet-Cookieor unsupportedVaryfields as dynamic, aligning probe output with final admission vetoesCache-Control,CDN-Cache-Control, andCloudflare-CDN-Cache-Controlconsistently, so framework revalidation cannot overwrite an explicit provider-private policy or write it to ISRWarming behavior
The default flow sends exactly one final cache-fill request for each admitted Route Handler identity. It does not perform a second fill or certification request.
Only
--warm-cdn-certifyenables the optional header-only re-request introduced by #3094. This keeps the stricter deployment check available without doubling normal warm traffic.Safety and Next.js parity
Static source configuration makes a Route Handler eligible for probing; it does not certify the request by itself. Runtime dynamic API usage, middleware or conditional routing participation, incomplete bodies, late errors, and private response policy remain fail-closed. A Route Handler omitted because Next.js would not statically generate it can enter bounded runtime admission only when the handler itself or unconditional
next.configheaders explicitly supply a public policy. Framework-generatedrevalidatepolicy does not qualify. For a route pattern represented in the manifest, unlisted pathname/query identities remain private even when the handler owns a public policy.For parameterized handlers, only concrete paths returned by
generateStaticParamsare admitted and warmed. Other paths remain private rather than relying on a route-pattern-wide assertion.Cloudflare Cache Rules must preserve the full query string for these exact identities. Query-insensitive or query-normalizing cache-key rules are unsupported because they can make distinct manifest identities share one edge object; this requirement is documented in the root, adapter, package, and workers-cache example documentation.
Boundaries
Vary: Cookie, change Worker entrypoints, or implement the separate uncached preview/draft gatewayReview guide
app-route-handler-dispatch.tsderives and memoizes Next.js-compatible static eligibility and wiresgenerateStaticParams.prerender-paths.tsdiscovers concrete Route Handler identities from the staged Worker.app-route-handler-execution.tsenforces completed-response handling before public policy can survive.cacheability-manifest.tsandcacheability-request.tsenforce exact Route Handler identity admission.cacheability-probe.ts,cdn-warm.ts, anddeploy.tscarry Route Handler identities through both deployment stages.Review size
Layer-only diff against #3098: 38 files, +1,396/-83.
Validation
Current exact head:
vp checkgit diff --check