Skip to content

docs: minimal Workers Cache adoption plan (Chapter 14)#47

Draft
scottmessinger wants to merge 2 commits into
mainfrom
claude/cloudflare-workers-cache-rynnl0
Draft

docs: minimal Workers Cache adoption plan (Chapter 14)#47
scottmessinger wants to merge 2 commits into
mainfrom
claude/cloudflare-workers-cache-rynnl0

Conversation

@scottmessinger

Copy link
Copy Markdown
Member

What

Adds docs/14-workers-cache-adoption.md (+ index link): the minimal-scope plan for adopting Cloudflare's July 2026 Workers Cache. Docs only; no code changes.

This replaces the over-scoped re-architecture proposal in #46 (gateway split, frame-addressed reads) — none of that is required to adopt the feature. The actual change is four steps: bump wrangler to ≥ 4.69.0, add [cache] enabled = true, move the custom domain onto the worker, delete packages/proxy + the EKS deployment.

The one correction that matters

The earlier proposal's handoff concluded the auth question was "resolved — no change needed" because the rk reader key is in the cache key. That misses how the requests actually look: auth-required reads carry Authorization: Bearer <JWT> (the rk is never validated; JWT is the single auth source, per Chapter 12).

  • Zone CDN today caches those reads anyway, because Cache-Control: public overrides the Authorization rule (RFC 9111 §3.5 / Cloudflare Origin Cache Control). Chapter 7's loadtests confirm it: identical Bearer tokens on every request, 98–99% HIT.
  • Workers Cache bypasses on the inbound request, before the response's public directive can matter — per Cloudflare's own docs, "nothing will ever be stored."

So after migration, private-stream reads BYPASS the native cache and the worker's internal caches.default + inFlight coalescing becomes the load-bearing collapsing layer for them. The doc's main prescription: keep that middleware — it is not redundant cleanup. Public streams get native-cache collapsing in front (plus tiered caching), same as the zone CDN today.

The doc also records a staging go/no-go checklist (collapsing parity, private-read BYPASS absorption, SSE lock behavior, cold-cache-per-deploy) and defers the Cloudflare-documented gateway/ctx.exports split as an optional later enhancement.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WBPrsDvrFACta2rq8qGLVF


Generated by Claude Code

Replaces the over-scoped re-architecture proposal from PR #46 with the
minimal adoption scope: enable native Workers Cache, move the custom
domain onto the worker, delete the nginx dummy origin. No auth,
protocol, or code changes.

Key correction vs the earlier proposal/handoff: Workers Cache bypasses
on inbound Authorization headers regardless of Cache-Control: public
(unlike the zone CDN today), so auth-required stream reads BYPASS the
native cache and the internal edge-cache/coalesce middleware becomes
the load-bearing collapsing layer for them — it must be kept, not
removed as redundant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBPrsDvrFACta2rq8qGLVF
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
durable-streams-demo-draw 9d989a6 Commit Preview URL

Branch Preview URL
Jul 08 2026, 09:17 PM

…napshot

The pkg.pr.new tarball for @cloudflare/vitest-pool-workers@11632 was
republished with different content, so pnpm install --frozen-lockfile
failed with ERR_PNPM_TARBALL_INTEGRITY on every CI job (also red on
PR #46). Update the lockfile to the checksum the registry now serves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBPrsDvrFACta2rq8qGLVF
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.

2 participants