Phuriwaj

Contact

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 (/functions folder)

Full-Stack Architecture Pattern

Browser
  ↓
Cloudflare Edge
  β”œβ”€β”€ /           β†’ Pages (React/HTML/CSS/JS)
  β”œβ”€β”€ /api/*      β†’ Workers (backend logic)
  └── /auth/*     β†’ Workers (auth handling)

Key Options / Variants

CloudflareEquivalent
PagesVercel / Netlify / GitHub Pages
WorkersAWS Lambda / Vercel Edge Functions
Pages + WorkersFull Vercel / Netlify stack
KVRedis (key-value, edge)
D1SQLite at the edge
R2AWS S3 (no egress fees)
QueuesAWS SQS
AIEdge LLM inference
Durable ObjectsStateful 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 /functions folder 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