Skip to content

fix(cloudflare): prewarm KV through deployed Workers - #3324

Merged
james-elicx merged 11 commits into
mainfrom
codex/kv-deploy-prewarm
Sep 20, 2026
Merged

james-elicx merged 11 commits into
mainfrom
codex/kv-deploy-prewarm

Conversation

@james-elicx

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

Copy link
Copy Markdown
Member

Summary

  • route prerender selections through the staged Worker when CDN pre-warming is enabled
  • let runtime-backed adapters, including KV, populate themselves from real Worker requests
  • avoid the duplicate local prerender and Wrangler KV bulk upload during pre-warm deploys
  • preserve local prerender artifacts for static export and non-pre-warm deployments
  • give standalone KV origin responses the build identity and cache-status capabilities required for certified staged warmup
  • skip discovered routes that do not participate in origin-managed data caching while retaining strict Response Store admission checks
  • deploy the same cache demo with Workers Response Store, standalone KV, and Workers Cache + KV
  • run the same deployed pre-warming E2E against all three backends
  • prove data-cache population through a no-store route that invokes the same use-cache function, independent of the response-cache layer

Testing

  • vp test run tests/cache-adapters-config.test.ts tests/cdn-cache.test.ts tests/deploy-prerender-config.test.ts tests/cloudflare-cdn-warm.test.ts (134 tests)
  • vp check
  • vp run vinext#build
  • vp run @vinext/cloudflare#build
  • VINEXT_CACHE_BACKEND=kv VINEXT_KV_APP_PREFIX=local-e2e vp run response-store-demo#build
  • local standalone KV Worker: page response MISS then HIT, no Workers Cache entrypoint, build identity present, and no-store route reused the page cached-function UUID
  • VINEXT_CACHE_BACKEND=workers-cache VINEXT_KV_APP_PREFIX=local-workers-cache vp run response-store-demo#build
  • git diff --check

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

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

create-vinext-app

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

@vinext/types

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

vinext

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

@cloudflare/workers-response-store

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

commit: 19d6097

@github-actions

github-actions Bot commented Sep 18, 2026 •

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

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 19d6097 against base e97de29 using alternating same-runner rounds. Next.js was unchanged and skipped.

1 improved · 0 regressed · 5 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.2 KB 142.2 KB ⚫ +0.0%
Client entry size (gzip) vinext 129.6 KB 129.6 KB ⚫ +0.0%
Dev server cold start vinext 3.20 s 3.13 s 🟢 -2.1%
Production build time vinext 3.63 s 3.60 s ⚫ -1.0%
RSC entry closure size (gzip) vinext 121.0 KB 121.1 KB ⚫ +0.0%
Server bundle size (gzip) vinext 218.3 KB 218.3 KB ⚫ +0.0%

View detailed results and traces

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

@james-elicx james-elicx changed the title fix(cloudflare): prewarm configured KV during deploy fix(cloudflare): prewarm KV through deployed Workers Sep 20, 2026
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

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

Comment thread packages/cloudflare/src/cdn-warm.ts Outdated
Comment thread packages/vinext/src/cache/cache-adapters-virtual.ts Outdated
Comment thread .github/workflows/deploy-examples.yml Outdated
@ask-bonk

ask-bonk Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Posted 3 actionable inline findings. Targeted tests passed: 110/110.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

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

Comment thread packages/cloudflare/src/cdn-warm.ts
@ask-bonk

ask-bonk Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Posted 1 new actionable inline finding. Targeted tests passed: 180/180.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

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

Comment thread .github/workflows/deploy-examples.yml Outdated
@ask-bonk

ask-bonk Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Posted 1 new actionable inline finding. Targeted tests passed: 180/180.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

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

Comment thread .github/workflows/deploy-examples.yml
@ask-bonk

ask-bonk Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Posted 1 new actionable inline finding.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

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

@ask-bonk

ask-bonk Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@james-elicx
james-elicx merged commit e5330aa into main Sep 20, 2026
79 checks passed
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