cloudflare trained
The learned layer of the cloudflare guru: a Worker handles compute, bindings give it typed access to account resources, and storage is picked by consistency and access pattern.
mental model
A Worker handles compute; bindings give it typed access to account resources. Pick storage by consistency and access pattern: Durable Objects coordinate one entity, D1 stores queryable records, KV distributes read-heavy values, and R2 stores objects. Wrangler config, generated binding types, and the compatibility date describe the project actually being run. Use cloudflare (the product picker) for other Cloudflare surfaces and confirm current limits in their official docs.
examples
This documented Workers Caching config caches eligible responses before the Worker runs. Review cache headers and sensitive responses before enabling it:
{"name": "catalog","main": "src/index.ts","compatibility_date": "2026-09-27","cache": { "enabled": true }}
This documented Email Service binding gives the Worker a native sending capability after the sender domain is onboarded:
{ "send_email": [{ "name": "EMAIL" }] }
best practices
- For new static or full-stack sites, Workers Static Assets is Cloudflare's default. Maintain existing Pages projects unless migration is in scope.
- For new cacheable Worker responses, Workers Caching runs before the handler. The independent Cache API is for explicit
match/put/deleteinside code. - Generate types from the project's Wrangler config, inspect the installed CLI help/schema, and test a changed compatibility date before deploying. Wrangler reference.
- Use SQLite-backed Durable Objects for new namespaces that need per-entity coordination; migrations and the configured compatibility date matter.
- Validate Turnstile tokens on the server with Siteverify and verify action/hostname when configured.
strengths
- One deployment can compose compute, static assets, and native bindings. Workers platform.
- Durable Objects provide a single coordination point per identifier; Workflows cover durable multi-step execution. DO rules, Workflows rules.
weaknesses / pain points
- Products differ in consistency, geography, request limits, and billing; do not swap KV, D1, R2, and Durable Objects by API resemblance alone. Storage selection.
- Framework adapters have compatibility gaps. Cloudflare recommends vinext for new Next.js Workers apps but calls it beta; run its compatibility check for an existing production app. Next.js guide.
gotchas
- Workers Caching may cache eligible responses without an explicit
Cache-Controlheader under default TTLs; set deliberate headers. - The Cache API is local to the originating data center, and
cache.put()does not support tiered caching. - Email Routing
addressesneeds Wrangler 4.113.0 or later; top-level config applies to every environment and an empty list removes this Worker's managed rules. - Turnstile tokens expire after five minutes and can be redeemed once.
known bugs
No version-specific defect has been reproduced in a project task. Do not label a documented platform limit or a missing CLI subcommand as a bug.
troubleshooting
| observed symptom | cause | fix |
|---|---|---|
wrangler email --help returns Unknown argument: email on local Wrangler 4.79.0 | this installed CLI has no email command | use documented dashboard/API onboarding; inspect project-local Wrangler before citing a CLI command |
| product picker said Workers Cache was the default for all application caching | it conflated pre-handler Workers Caching with in-handler Cache API | choose by where cache access occurs; see Workers cache docs |
| Cloudflare One migration entry said Split Tunnel changes had no API | Devices API exposes custom profile excludes | decide dashboard or API from the approved migration workflow |
practiced cases
- A local CLI inspection (Node 24.14.1, Wrangler 4.79.0) showed
wrangler --versionreturning4.79.0,wrangler deploy --helplisting--dry-run, andwrangler email --helpreturningUnknown argument: email. No account, Worker deployment, cache behavior, email delivery, or app runtime was exercised. This is a narrow tool probe, not a proven project implementation.