Persist functional WordPress state in Cloudflare#1886
Conversation
|
Cloudflare deployment orchestration is tracked in Extra-Chill/homeboy-extensions#2303. This PR is the first consumer: exact-revision deploy, login/publish/assets gate, same-revision redeploy, and MDI/R2 reconstruction proof. |
|
Remote deployment evidence for exact commit
Root cause: first boot converts the SQLite seed to canonical MDI files and then starts the canonical runtime inside one Durable Object isolate. The fix is to package a prebuilt canonical MDI seed so cold bootstrap creates only one PHP-WASM runtime from canonical files; SQLite remains disposable. Remote durability claims remain blocked until login/publish/redeploy passes. |
|
Follow-up remote evidence for exact commit
The remaining architectural issue is hosting PHP-WASM inside the Durable Object. The next correction keeps PHP-WASM in the entry Worker and restores the DO to a lightweight global lease/current-pointer CAS coordinator. Canonical MDI/R2 state and the prebuilt seed remain unchanged. |
|
Remote evidence for exact commit
The remaining memory source is the selected WordPress filesystem: the predicate currently includes every file under |
|
Remote evidence for exact commit
MEMFS overhead plus PHP-WASM still makes 53.7 MB too large. The next boundary keeps only server-executed PHP/templates/metadata in PHP MEMFS and serves individual static CSS/JS/font/image requests by exact bounded Range extraction from the WordPress archive. WordPress script concatenation will be disabled so browser assets do not need to live in PHP memory. |
|
Remote evidence for exact commit
The boot-critical dependency is now external multi-range assembly of 1,810 WordPress files. The correction moves the filtered server corpus into a deterministic deployment artifact stored in R2. Worker boot will stream one R2 object into MEMFS; browser assets remain lazy exact-range/cache requests. |
Final verification updateThe diagnostic-free head
Two independent infrastructure/tooling gaps remain tracked:
No diagnostic routes or R2 stage artifacts from the investigation remain in the final Worker. |
|
Dev-rig and corpus repair pushed in What changed
Verification
No production deployment was performed. |
…ounded-browser # Conflicts: # package-lock.json
Production deployment evidenceExact head
One login-form request during cold reconstruction returned a transient |
…ounded-browser # Conflicts: # tests/playground-phpunit-readonly-cache.integration.test.ts
Summary
Run a functional WordPress site in a Cloudflare Worker with PHP-WASM in the entry Worker, a lightweight Durable Object lease/CAS coordinator, canonical Markdown/JSON state in R2, and disposable reconstructed SQLite.
The runtime supports WordPress login,
wp-admin, the block editor, authenticated publishing and media upload, public rendering, complete core block styles, browser assets, serialized concurrent mutations, cold reconstruction, and revision-addressed public page caching.What changed
WordPressStateCoordinatorExact-head verification
Verified and deployed at
16d87b5dfa574505be7aaaf86167a9da4469542e:npm run test:cloudflare-runtime: 22 passed, including bounded wp-content/tombstone validation, runtime archive integrity, static artifact range validation, upload security boundaries, and TypeScriptnpm run test:cloudflare-wordpress-archive-corpus: passed against the real WordPress archivenpm run cloudflare:dry-run: passed; 23,101.17 KiB / gzip 8,335.06 KiBnpm run cloudflare:local-gate: passed under Wrangler/workerdThe full local gate proves the canonical MDI full-boot path, explanatory homepage, complete block styles, revision page cache, login, authenticated dashboard, real block editor, two serialized concurrent canonical mutations, authenticated REST publication and media upload, a real plugin ZIP installation and activation, direct R2 plugin CSS delivery, bundled-theme deletion tombstones, byte-exact direct R2 media delivery, exact static R2 range delivery and GET/HEAD semantics, public post rendering, Worker stop/start, persisted post, attachment, plugin code, plugin asset, deletion, and authenticated-session recovery.
The exact head is deployed at https://wp-codebox-cloudflare-runtime.chubes.workers.dev/ through the immutable Homeboy Cloudflare deployment contract. Deployment
e4407b8d-b5c3-40d6-8a15-62e3a132aae6selects Worker version8133912e-0d7c-4b93-b151-6ee04cd34691. Its same-revision durability redeploy passed the homepage in 810 ms and the representative static asset in 76 ms after runtime replacement. Three production canonical full-boot probes completed in 1.41–1.63 seconds. Production headers confirmx-wp-codebox-static: r2-range, an immutable one-year cache policy, exact content length, and a byte-derived SHA-256 ETag.Architecture
Compatibility
Cloudflare runtime state changes from isolate-local mutable state to serialized canonical MDI revisions in R2. Existing health, state, synthetic mutation, and bounded boot-probe routes remain. Token-protected operator reset and restore routes are additive. No public package API is removed.
Source relationships
AI assistance
openai/gpt-5.6-sol