Skip to content

Cloudflare

Hosting + CDN + cache purge. Three Pages projects (DEV / UAT / PROD).

Roles

CapabilityUse
PagesHosts the built SPA (dist/). One project per env; "Production branch" renamed dev/uat/production.
CDN cachePublic pages cached at the edge — target hit-rate >95%.
Cache purge APICalled from Edge Functions (_shared/cloudflare.ts) to invalidate/refresh.
wranglerDeploy tooling (a devDependency).

Cache lifecycle (public_page_ops)

The four Type B functions: public_page_ops_cache_refresh, public_page_ops_cache_invalidate, public_page_ops_health_check, public_page_ops_metrics_collector. See the EF index and documentation/public-page-ops/.

Secrets

CLOUDFLARE_API_TOKEN, CLOUDFLARE_ZONE_ID — documented in .env.example, set per Supabase project.

Gotchas

  • "Production branch" must be renamed per project (dev/uat/production) or deploys target the wrong env.
  • Bot Fight Mode can return 403 to smoke checks — allowlist the checker.
  • Security headers / CSP are applied at the edge — see Security.

See Environment Strategy · Deployment & Promotion.