Cloudflare Workers & Pages
Two separate but complementary Cloudflare products that together form a full-stack hosting platform.
Why / When to Use
Use when you want a Vercel/Netlify-equivalent stack without vendor lock-in, with generous free tier and edge-native performance. Practical for: BOL webhook receivers, API proxies, cron jobs, internal tool frontends.
Core Concept / Commands
Cloudflare Pages β Static Site Hosting
Pages β Vercel / Netlify / GitHub Pages
- Connects to GitHub/GitLab β auto-builds and deploys on push
- Supports React, Next.js, Vue, Nuxt, Astro, plain HTML
- Free tier: very generous (unlimited requests, 500 builds/month)
- Branch preview deployments built in
- Site lives at
yourapp.pages.dev(or custom domain)
Cloudflare Workers β Serverless Functions
Workers β AWS Lambda / Vercel Edge Functions
- Runs code at the edge (globally distributed)
- Can be standalone API or attached to a Pages project
- Pages Functions = Workers built into your Pages project (
/functionsfolder)
Full-Stack Architecture Pattern
Browser
β
Cloudflare Edge
βββ / β Pages (React/HTML/CSS/JS)
βββ /api/* β Workers (backend logic)
βββ /auth/* β Workers (auth handling)
Key Options / Variants
| Cloudflare | Equivalent |
|---|---|
| Pages | Vercel / Netlify / GitHub Pages |
| Workers | AWS Lambda / Vercel Edge Functions |
| Pages + Workers | Full Vercel / Netlify stack |
| KV | Redis (key-value, edge) |
| D1 | SQLite at the edge |
| R2 | AWS S3 (no egress fees) |
| Queues | AWS SQS |
| AI | Edge LLM inference |
| Durable Objects | Stateful WebSockets / real-time |
BOL-Specific Use Cases
- Webhook receiver β lightweight Worker for GitHub/Discord webhooks (no server needed)
- API proxy β add auth headers, rate limiting, response transforms before backend
- Internal tools frontend β deploy Next.js dashboard on Pages, Workers handle API
- Cron triggers β Workers support scheduled cron (alternative to GitHub Actions for non-repo tasks)
Gotchas
- Pages Functions (built-in Workers) live in
/functionsfolder of the Pages project - Workers have a CPU time limit per request (50ms on free, 30s on paid)
- D1 is SQLite-compatible but not PostgreSQL β schema design differs
- Durable Objects require paid plan
Source
Conversation: βCloudflare Workers vs GitHub Actionsβ β 2026-06-02