feat(cache): probe Pages Router cacheability - #3098
Conversation
c54f8dc to
499968c
Compare
commit: |
Performance benchmarksCompared 1 improved · 0 regressed · 5 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
499968c to
0c42688
Compare
|
0c42688 to
56e9bd5
Compare
4c463a5 to
49db635
Compare
|
/bigbonk review for issues Hard time limit: 10 minutes. Review the exact current head only. |
|
error: Your local changes to the following files would be overwritten by checkout: |
|
@james-elicx Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
49db635 to
447d3c9
Compare
|
/bigbonk review for issues Please return all findings within a hard 10-minute limit. |
|
error: Your local changes to the following files would be overwritten by checkout: |
dbe4141 to
18e9667
Compare
|
/bigbonk review for issues. Hard time limit: 20 minutes; return all findings or a partial review by then. |
18e9667 to
1409c0f
Compare
b1e5316 to
c8de27d
Compare
c8de27d to
60e9abe
Compare
299afed to
94bcd91
Compare
94bcd91 to
b40e1a9
Compare
Capability stack 8/9. Exact head:
b40e1a98c03334c1aaf5c7eaf9930acd47a8d66c. Base: #3094.Full chain: #3108 → #3090 → #3091 → #3092 → #3103 → #3093 → #3094 → #3098 → #3113.
This is the Pages Router capability layer. Without it, App Router probing and two-stage warming work, while Pages routes retain safe route-owned caching but are not classified or warmed by the two-stage flow. #3113 completes the cumulative capability by adding statically eligible Route Handlers.
What this adds
/_next/data/<buildId>/*.jsonrequest identities inside the staged WorkergetStaticProps/ISR HTML as cache candidatesgetStaticProps/ISR routes; automatic-static pages do not invent data endpointsgetServerSidePropsand custom pagegetInitialPropsas dynamic without executing request-time data functions during probing_app.getInitialPropsbehavior: automatic-static pages become dynamic, whilegetStaticPropspages remain cache candidatesnullnext.configcache policy for App Pages, includingforce-dynamic, while retaining middleware-over-config precedenceWarming and certification behavior
The default flow probes each eligible App or Pages identity once and requests it once again to fill the final Worker's CDN cache. It does not make a second fill/certification request.
If
--warm-cdn-certifyis explicitly supplied, the optional header-only pass from #3094 re-requests warmed identities before promotion. Certification is disabled by default.Next.js parity
The classification follows the Pages data-contract split used by Next.js: automatic static optimization and
getStaticPropsHTML are reusable unless a custom_app.getInitialPropsopts automatic-static pages out;getStaticPropspages remain static.getStaticProps/ISR data endpoints receive the same static/ISR cache policy;getServerSidePropsand pagegetInitialPropsremain request-time. Default-locale data URLs and hybrid route ownership match the upstream client/build behavior. The tests link to the upstream prerender, i18n data-route, preview, middleware matcher, and getServerSideProps suites.Known safe parity gap
Discoverable exact identities match the staged probe. Runtime-generated
fallback: true/blockingpaths that were not discovered remainno-storeat the CDN, while Next.js can cache them after successful runtime generation. This is fail-closed and prevents disclosure, but is a CDN-performance parity gap for a separately reviewable pattern-contract/runtime-admission follow-up.External gateway boundary
A preview/draft cookie request can still consume an already-cached anonymous edge HIT before this single Worker entrypoint runs. This stack deliberately does not add
Vary: Cookieor multi-entrypoint behavior; the separate uncached-gateway stack owns that edge-before-Worker boundary.Rollout requirement
Deploying the fixed Worker cannot remove objects that a vulnerable Worker version already admitted to the shared CDN cache. The security rollout must purge/invalidate existing cache entries when customers upgrade and redeploy. After that purge, this stack prevents unsafe refills; the embedded classification manifest itself survives later content-cache purges.
Review guide
packages/vinext/src/server/pages-router-entry.tsexposes authenticated Pages probe handling, registers adapters before admission, and enables capability-based no-manifest completion handling.packages/vinext/src/server/pages-page-handler.tsclassifies Pages HTML and data contracts.packages/vinext/src/build/prerender-paths.tsreports concrete Pages data identities for realgetStaticProps/ISR routes.packages/vinext/src/server/app-pages-bridge.tstransfers hybrid Pages admission ownership.packages/vinext/src/server/cacheability-request.tsandcacheability-manifest.tsenforce exact HTML/data identity and fail-closed admission.packages/cloudflare/src/cdn-warm.tssends browser-equivalent HTML, RSC, and Pages data requests and validates each representation.Review size
Layer-only diff against this PR's base: 49 files, +1,754/-165.
Validation
vp checkandgit diff --check