Skip to content

fix(cloudflare): tolerate Response Store lookup outages - #3523

Merged
james-elicx merged 3 commits into
mainfrom
codex/fix-response-store-lookup-outages
Sep 28, 2026
Merged

james-elicx merged 3 commits into
mainfrom
codex/fix-response-store-lookup-outages

Conversation

@james-elicx

@james-elicx james-elicx commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Response Store lookup exceptions and error responses currently escape the data cache or get served as a response-cache hit, turning a temporary cache failure into a failed request. Treat failed reads as cache misses, log an error, and use the normal render and cache-fill path. Data reads also fall back when body consumption, soft-tag validation, or corrupt-entry cleanup fails. Cached redirects remain hits, and warmup RSC reads use the same fallback. Ordinary response-cache fill failures also preserve the rendered response; explicit warmup fills still report persistence failures.

The behavior belongs in this Cloudflare adapter: Next.js delegates custom-handler reads to the handler and its filesystem adapter returns null on storage read errors. Explicit cache mutations retain their existing error behavior.

Validation:

  • Reproduced lookup failures before the fix in the adapter and Worker tests, plus built-Worker Miniflare response-stage tests returning 500.
  • vp test run tests/cloudflare-response-store-worker.test.ts tests/cache-adapters-config.test.ts tests/isr-cache.test.ts tests/fetch-cache.test.ts — 274 passed.
  • pnpm --filter @vinext/cloudflare exec vitest run — 46 passed, including fault injection and recovery through real service-binding Workers, plus existing self-contained coverage.
  • Built @vinext/cloudflare and both response-store-demo deployment modes; targeted vp check passed for all changed files.

Fixes #3432.

@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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

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

create-vinext-app

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

@vinext/types

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

vinext

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

@cloudflare/workers-response-store

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

commit: 21fb348

@ask-bonk

ask-bonk Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 21fb348 against base 074e64f 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 143.4 KB 143.4 KB ⚫ -0.0%
Client entry size (gzip) vinext 131.5 KB 131.5 KB ⚫ 0.0%
Dev server cold start vinext 3.33 s 3.31 s ⚫ -0.6%
Production build time vinext 3.89 s 3.86 s ⚫ -0.7%
RSC entry closure size (gzip) vinext 132.9 KB 132.9 KB ⚫ +0.0%
Server bundle size (gzip) vinext 234.7 KB 234.7 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-assets-cache preview production
static-export preview production
web preview production

@james-elicx
james-elicx marked this pull request as ready for review September 28, 2026 00:19
@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 28, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@james-elicx
james-elicx enabled auto-merge (squash) September 28, 2026 12:15
@james-elicx
james-elicx merged commit da6523d into main Sep 28, 2026
82 checks passed
@james-elicx
james-elicx deleted the codex/fix-response-store-lookup-outages branch September 28, 2026 12:20
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.

@vinext/cloudflare: a Response Store outage turns every cache lookup into an uncaught exception instead of a cache miss

1 participant