Skip to content

design: render Cloudflare sites inside a Durable Object - #4790

Draft
swissky wants to merge 2 commits into
emdash-cms:mainfrom
swissky:design/cloudflare-site-durable-object
Draft

swissky wants to merge 2 commits into
emdash-cms:mainfrom
swissky:design/cloudflare-site-durable-object

Conversation

@swissky

@swissky swissky commented Nov 10, 2026

Copy link
Copy Markdown
Member

Design proposal

Proposal: proposals/cloudflare-site-durable-object.md

On Workers with D1, uncached pages are slow for two reasons: 14 to 25 D1 queries per page at about 17 ms each, and cold isolates on low-traffic sites (1.1 to 2.4 s in my tests). This RFC proposes an opt-in mode in @emdash-cms/cloudflare where the Astro app and the site's SQLite database run in the same Durable Object, behind a tiny front Worker that owns the Workers Cache. D1 stays the default, and the existing durableObjects() adapter is unchanged.

I've run three sites this way since November 8 on stock EmDash 1.4.0. The uncached HTML median went from 2,837 to 291 ms on scllauerz.ch, 726 to 204 ms on kevinkyburz.ch and 1,184 to 450 ms on linguadash.dev. The RFC covers the trade-offs (one region for all misses, one thread per site, sandboxed plugins, backups, deploys) and lists 18 open questions. Six of them must be settled before acceptance. Full measurements: https://kevinkyburz.ch/blog/emdash-durable-object/

Proposal type

  • Feature plan
  • RFC
  • Amendment, supersession, or withdrawal

Related work

Discussion: #4789

Depends on #4406 and #4725 (sandbox plugin bridge uses the configured database, #1623). Touches co-editing on Cloudflare (#4680) and media cache headers (#4498). No conflicting accepted proposals.

Readiness

  • The proposal identifies its author and, for an RFC, its champion and Maintainer sponsor
  • The proposal describes observable behavior, compatibility, failure handling, and verification in proportion to its risk
  • Conflicting accepted or pending proposals are reconciled in this pull request
  • This pull request contains no implementation code
  • The proposal status is accepted (check only when ready to merge)

AI assistance

  • This proposal used AI assistance — model/tool: Claude Opus 5.5

@changeset-bot

changeset-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6997bfa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant