Cloud & Infrastructure
Engineering a Zero-to-Low-Cost Cloud Stack Using Cloudflare Pages, Edge Functions, and Supabase
Keeping production availability, dynamic CMS publishing, and automated CI/CD inside free-tier limits

Summary: How to combine static Vite builds, edge request-time HTML injection, Supabase free tier, and batched GitHub Actions deployments without recurring server bills.
Design Constraints
An independent engineer or early venture needs high uptime, global CDN performance, real HTTPS, database-backed CMS updates, and clean SEO without paying for idle containers or over-triggering build quotas.
Stack Decisions
- Static CDN + Selective Edge Functions (
_routes.json): Exclude/assets/*,/img/*,/css/*,/js/*,/fonts/*from function invocation so edge compute runs only on HTML/API/XML routes. - Runtime Content Separation: Code/UI changes deploy via GitHub → Cloudflare Pages; content updates publish immediately through Admin → Supabase without triggering unnecessary rebuilds.
- Cache Discipline: Fingerprinted Vite assets get
max-age=31536000, immutable, while dynamic HTML pages usemax-age=0, must-revalidateso edits propagate cleanly. - Automated Pre-Deploy Checks: Running secret scanning,
verify-dist, andwrangler pages devroute smoke tests in CI catches regressions before production.