A framework-free reference application for transforming existing HTML without buffering or rebuilding the origin. The Worker validates a deployment-controlled Wikipedia route, fetches and caches the source article, then composes streaming HTMLRewriter handlers for a dark editorial redesign, coarse request-location context, Spanish title and summary translation, and an AI-generated dad joke. A typed mode registry keeps routing, AI selection, stylesheets, link rewriting, and source-code links synchronized. Visitor credentials never reach the origin, scripts are removed, redirects remain origin-bound, AI output is sanitized before insertion, and a native Rate Limiting binding degrades paid inference to the plain article when the public-demo budget is unavailable.
Browser
│ GET /<mode>/wiki/<article>
▼
Cloudflare Worker
├── read-only route + redirect policy
├── configured Wikipedia origin ── edge-cached HTML stream
├── request.cf ────────────────── coarse context only
├── Rate Limiting binding ─────── per-mode AI guardrail
└── Workers AI + AI Gateway ───── translation + dad joke
▼
Streaming HTMLRewriter
├── compose mode handlers + rewrite links/assets
├── remove scripts + isolate credentials + apply CSP
└── local CSS/font assets + source attribution
▼
Transformed article (private, no-store, noindex)