Cloudflare Pages: Deploy Static Sites to the Edge
Complete guide to deploying Astro, Next.js, and static sites on Cloudflare Pages with global CDN and zero cold starts.
Why Cloudflare Pages?
Cloudflare Pages delivers static sites from 300+ edge locations with:
- Zero cold starts
- Unlimited bandwidth on free tier
- Git integration
- Preview deployments
Setup for Astro
Build command: npm run build
Output directory: dist
Node version: 22
Configuration
Connect your GitHub repository, set environment variables, and deploy. Every push to main triggers a production build.
Performance
Static assets are cached at the edge globally. HTML pages benefit from Cloudflare’s CDN with automatic HTTP/2 and Brotli compression.
Comparison
See how Cloudflare stacks up in our Vercel vs Netlify comparison — Cloudflare often wins on price and global reach for static content.
Frequently Asked Questions
Is Cloudflare Pages free?
Yes. The free tier includes unlimited static requests, 500 builds/month, and global CDN distribution.
What build command for Astro?
Use 'npm run build' with output directory 'dist' and Node.js version 22.
Does Cloudflare Pages support SSR?
Yes via Pages Functions, but static generation is recommended for content sites.
Related Articles
Astro Static Sites: The Developer's Guide to Fast Content Platforms
Build blazing-fast static sites with Astro 5 — content collections, MDX, islands architecture, and deployment.
AI Coding Tools in 2025: The Complete Developer's Guide
A comprehensive guide to AI coding assistants — Cursor, Copilot, Windsurf, Cody, and how to choose the right tool.
Next.js 15 Complete Guide for Production Apps
Everything you need to know about Next.js 15 — App Router, Server Actions, caching, and deployment best practices.
SaaS Pricing Strategies That Actually Convert
Proven pricing models for SaaS startups — freemium, usage-based, tiered plans, and optimization tactics.