Skip to content

fix(cloudflare): keep CDN warmup correct with custom adapters and i18n - #3024

Closed
james-elicx wants to merge 1 commit into
codex/rsc-prewarm-hybrid-ownershipfrom
codex/rsc-prewarm-fresh-review-fixes
Closed

fix(cloudflare): keep CDN warmup correct with custom adapters and i18n#3024
james-elicx wants to merge 1 commit into
codex/rsc-prewarm-hybrid-ownershipfrom
codex/rsc-prewarm-fresh-review-fixes

Conversation

@james-elicx

@james-elicx james-elicx commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

Keeps deploy-time CDN warming correct when applications use custom cache adapters or hybrid App/Pages Router i18n routes.

  • expose build-identity response headers as a generic CDN adapter capability; the built-in Cloudflare adapter now guarantees X-Vinext-Build-Id on every page response
  • verify staged HTML only when the adapter declares that capability; strict warmup fails before upload when exact-build HTML warming cannot be proven, while non-strict deploys defer that HTML work until after promotion and label it best-effort
  • validate response build identity before accepting cache admission or a non-cacheable skip, so an old deployment's BYPASS response cannot suppress warming for a route that became cacheable
  • treat Cloudflare cache admission statuses as authoritative while rejecting unsafe plain Set-Cookie MISS responses and accepting explicit field-qualified cookie policy
  • preserve hybrid route ownership under Pages Router i18n by normalizing locale prefixes for page matching without reclassifying locale-prefixed App routes as Pages API routes

This is stacked on #3023.

Validation

  • 88 focused tests across CDN response validation, staged deploy orchestration, adapter capabilities, prerender path discovery, deploy config wiring, and hybrid i18n handoff
  • targeted formatting, lint, and type checks for all 11 changed files
  • vp run vinext#build
  • vp run @vinext/cloudflare#build

Cloudflare admission behavior was checked against the current cache response and CDN-Cache-Control documentation. The hybrid locale/API behavior follows Next.js' test/e2e/i18n-api-support/index.test.ts coverage.

@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@3024
npm i https://pkg.pr.new/create-vinext-app@3024
npm i https://pkg.pr.new/@vinext/types@3024
npm i https://pkg.pr.new/vinext@3024

commit: c36af17

@james-elicx james-elicx changed the title fix(cloudflare): address CDN warmup review findings fix(cloudflare): handle custom adapters and i18n during CDN warmup Aug 22, 2026
@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
workers-cache preview production
web preview production

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared c36af17 against base 4035031 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 142.0 KB 142.0 KB ⚫ -0.0%
Client entry size (gzip) vinext 129.3 KB 129.3 KB ⚫ -0.0%
Dev server cold start vinext 2.58 s 2.59 s ⚫ +0.4%
Production build time vinext 2.80 s 2.79 s ⚫ -0.3%
RSC entry closure size (gzip) vinext 116.0 KB 116.0 KB ⚫ -0.0%
Server bundle size (gzip) vinext 197.5 KB 197.5 KB ⚫ -0.0%

View detailed results and traces

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

@james-elicx
james-elicx force-pushed the codex/rsc-prewarm-fresh-review-fixes branch from 5d72882 to c972e38 Compare August 22, 2026 00:32
@james-elicx james-elicx changed the title fix(cloudflare): handle custom adapters and i18n during CDN warmup fix(cloudflare): keep CDN warmup correct with custom adapters and i18n Aug 22, 2026
@james-elicx

Copy link
Copy Markdown
Member Author

Superseded by consolidated PR #3040. No commits were dropped or rewritten: #3040 now contains this exact linear commit as part of #3021#3040. Closing only the redundant draft PR.

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