Cloudflare Pages has transformed modern web deployment by pairing unlimited bandwidth, edge caching across 300+ cities, and seamless serverless compute into one unified developer platform.
Direct Upload Deployments via Wrangler
While Git-integrated deployments are common, direct upload via Cloudflare's CLI tool (wrangler) offers tremendous power for custom pipelines, monorepos, and local-to-cloud sync:
# Authenticate and deploy in a single command
CLOUDFLARE_API_TOKEN=<token> CLOUDFLARE_ACCOUNT_ID=<account_id> \
npx wrangler pages deploy ./dist \
--project-name=prismablog \
--branch=main \
--commit-dirty=true
The Power of Cloudflare Edge Rules
Cloudflare Pages evaluates two key static configuration files placed in your output directory:
1. _headers for Bank-Grade Security
Define HTTP response headers per path or glob. You can enforce Strict-Transport-Security (HSTS), Content-Security-Policy (CSP), and configure immutable asset caching for hashed bundles:
/*
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
/_astro/*
Cache-Control: public, max-age=31536000, immutable
2. _redirects for Clean URL Migrations
Support 301 permanent redirects, 302 temporary redirects, and client-side SPA fallbacks with zero performance penalty.
Global Latency Breakdown
When an asset is uploaded to Pages, Cloudflare's tiered cache architecture distributes it across continental super-POPs. Requests from Tokyo, Frankfurt, or São Paulo hit edge memory caches with sub-15ms round-trips.