fix(cache): share query-independent response entries - #3390
james-elicx wants to merge 44 commits into
Conversation
@vinext/cloudflare
create-vinext-app
@vinext/types
vinext
@cloudflare/workers-response-store
commit: |
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
|
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
3d6dc29 to
5932366
Compare
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
| // path, not runtime-attacker-controlled input — a false positive. | ||
| imports.push(`const ${varName} = () => import(${JSON.stringify(absPath)});`); | ||
| imports.push( | ||
| `const ${varName} = () => import(${JSON.stringify(absPath)})${clientConfig && Object.keys(clientConfig).length > 0 ? `.then((mod) => ({ ...mod, ...${JSON.stringify(clientConfig)} }))` : ""};`, |
| // path, not runtime-attacker-controlled input — a false positive. | ||
| imports.push(`const ${varName} = () => import(${JSON.stringify(absPath)});`); | ||
| imports.push( | ||
| `const ${varName} = () => import(${JSON.stringify(absPath)})${clientConfig && Object.keys(clientConfig).length > 0 ? `.then((mod) => ({ ...mod, ...${JSON.stringify(clientConfig)} }))` : ""};`, |
| // path, not runtime-attacker-controlled input — a false positive. | ||
| imports.push(`const ${varName} = () => import(${JSON.stringify(absPath)});`); | ||
| imports.push( | ||
| `const ${varName} = () => import(${JSON.stringify(absPath)})${clientConfig && Object.keys(clientConfig).length > 0 ? `.then((mod) => ({ ...mod, ...${JSON.stringify(clientConfig)} }))` : ""};`, |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
|
/bigbonk review for issues Time limit: 8 minutes. Complete the review and post all findings within that limit. |
|
LGTM! |
Summary
ctx.propsonly when explicit static/error route config or an exact-path/representation cacheability manifest supplies pre-lookup evidence. Otherwise the query stays in the key.use cache, Pages Router, rewrite destination, and representation boundaries. Add existing-demo-fixture regressions across KV, Workers Cache, Response Store service-binding and self-contained modes, including on-demand static exports, static handlers, HTML/RSC, client SSR, metadata, and explicit public policy.Parity and safety
Next.js treats Page
searchParamsas a dynamic API (docs, test). A completed query-independent Server Page artifact is reusable by pathname; explicitly static routes provide build-time proof even for nonstandard default exports. A force-static Route Handler strips its request query (test). Explicit public policy may instead cache dynamic output separately by query (test).A default Client Page currently cannot distinguish actual
searchParamsconsumption from React's serialization of the client-reference prop. Workers Cache therefore keeps unproven Client Pages query-keyed; Response Store bypasses default Client Pages rather than admitting an empty-query false static artifact. This creates extra misses for Client Pages that ignore the prop, but prevents cross-query leakage. Workers Cache still buffers some cold misses before delivery, as before this PR; this change does not claim streaming-miss parity. Cache Components/PPR postponed-shell parity remains out of scope.Verification
672c41614e7a6729feb36a26eb4b2d7645dc0038: CI passed (55 jobs). Deploy Examples passed on attempt 2. KV, Workers Cache, and Response Store deployed cache E2Es all passed on their first attempt; the unrelated preview smoke job passed on retry after a shell broken-pipe false negative (the same preview smoke script passed locally, 20/20).Keep this PR draft for human review; do not merge or mark ready automatically.