Cloudflare Pages

On this page 7

Cloudflare Pages is a static and JAMstack hosting platform that builds websites directly from a Git repository or an uploaded folder and serves the resulting files from Cloudflare’s global edge network. In hosting for servers and web applications, it represents the serverless model: there is no machine to manage, no web server to configure and no capacity to plan, because every deployment is distributed to data centers worldwide.

The service combines continuous deployment, automatic HTTPS, preview URLs for every branch and optional server-side logic through Pages Functions. It competes directly with Netlify, Vercel and GitHub Pages, and it is closely tied to the Cloudflare Workers runtime, which powers its dynamic features.

How Cloudflare Pages builds and deploys a site

Cloudflare Pages turns a source repository into a globally distributed, immutable deployment in a sequence of automated steps. A push to a connected GitHub or GitLab repository triggers a build in an isolated container, where the configured build command runs and produces an output directory such as dist or public.

The platform then uploads the output to its edge storage, hashes each file and assigns a unique deployment URL. Because deployments are immutable, a rollback simply points the production domain back to an earlier build, which takes seconds and requires no rebuild.

The following table lists the three main ways to create a deployment.

MethodHow it worksBest suited for
Git integrationBuilds on every push to GitHub or GitLabTeams using pull requests
Direct UploadUploads a prebuilt folder in the dashboardSimple sites and quick tests
Wrangler CLIDeploys from a terminal or CI pipelineCustom build systems and automation
Deployment methods in Cloudflare Pages

Branch deployments are a core part of the workflow. Every non-production branch and pull request receives its own preview address on the pages.dev domain, so reviewers can check changes in a real environment before they reach the production branch.

Pages Functions and dynamic capabilities

Pages Functions add server-side code to an otherwise static site by running JavaScript or TypeScript on the Cloudflare Workers runtime. Files placed in a functions directory become routes automatically, so a file named functions/api/contact.js handles requests to /api/contact.

Functions run in V8 isolates rather than containers, which gives cold starts measured in milliseconds but also imposes limits on CPU time, memory and available Node.js APIs. Functions can bind to other Cloudflare services such as the KV key-value store, the D1 database and R2 object storage.

AspectStatic assetsPages Functions
ExecutionNone, files served from cacheCode runs per request at the edge
Typical latencyVery low, served from nearby locationLow, plus processing time
Billing modelRequests generally freeCounted against Workers request quotas
Typical usePages, images, scripts, stylesForms, authentication, API proxies
Static files compared with Pages Functions

Behavior at the edge can also be configured without code. A _redirects file defines URL redirects and rewrites, and a _headers file sets response headers such as security policies or cache control directives for chosen paths.

Comparison with other hosting models

Cloudflare Pages belongs to the static site hosting category and differs fundamentally from shared hosting, virtual servers and managed WordPress hosting. It suits sites that can be prebuilt into files, while applications that need a persistent server process or a traditional relational database on the same machine fit other models better.

OptionServer managementDynamic codeTypical fit
Cloudflare PagesNoneEdge functionsStatic sites, JAMstack front ends
GitHub PagesNoneNot supportedDocumentation and project pages
Netlify or VercelNoneServerless and edge functionsFramework-based web applications
Shared hostingProvider-managedPHP and databasesSmall CMS websites
Virtual private serverFull responsibilityAny language or serviceCustom back ends
Cloudflare Pages and neighboring hosting options

Its main differentiator is that static asset bandwidth is not metered on the free plan, while some competitors charge for bandwidth beyond a quota. In recent years Cloudflare has also extended Workers to serve static assets, and new full-stack projects are increasingly directed there, so teams should evaluate both products when starting a new application.

Limits, plans and configuration choices

Cloudflare Pages enforces build and file limits that shape how large projects are structured. The exact values depend on the plan and change over time, so the figures below describe the general order of magnitude rather than a contractual guarantee.

ConstraintApproximate valuePractical impact
Builds per monthAbout 500Frequent pushes may need batching
Concurrent builds1Builds queue during busy periods
Files per deploymentAbout 20,000Large media libraries need R2
Maximum single file sizeAbout 25 MiBVideos and archives belong elsewhere
Custom domainsSupported with automatic TLSNo certificate management needed
Typical constraints on the free plan

Correct build configuration prevents most failed deployments. The framework preset, build command, output directory and environment variables must match the project, and the Node.js version should be pinned through an environment variable or a version file so builds remain reproducible.

Risks and common mistakes

Most problems with Cloudflare Pages come from misunderstanding the static model rather than from platform failures. Teams migrating from traditional servers sometimes expect behavior that a file-based edge platform does not provide.

  • Exposed preview deployments can leak unreleased content unless access is restricted with Cloudflare Access.
  • Secrets in client bundles become public, because anything in the build output is downloadable.
  • Wrong output directory settings produce empty or broken deployments without an obvious error.
  • Single-page application routing fails on deep links unless a fallback rule or framework adapter is configured.
  • Vendor lock-in grows when Functions rely heavily on proprietary bindings such as KV or D1.

In everyday language

Cloudflare Pages is a way to put a website online without renting or running a server. A developer keeps the website files in an online folder, and every time something changes, Cloudflare rebuilds the site automatically and copies it to hundreds of locations around the world.

Think of it like a newspaper printed once and delivered to every corner shop at the same time, instead of one central kiosk where everyone has to queue. Visitors get the copy closest to them, so pages load quickly almost everywhere.

Seen in the real world

A small software company maintains a product documentation site with about 1,500 pages generated by a static site generator. It previously ran on a single virtual server in one region, and readers in Asia and South America reported load times above three seconds.

The team connects the documentation repository to Cloudflare Pages, sets the build command and output directory and adds the company subdomain with automatic TLS certificates. Writers now open pull requests and share the preview link with product managers before merging.

After the migration, typical page loads fall well under one second in all regions, the virtual server is retired and hosting costs for the site drop to nearly zero. A short Pages Function forwards the feedback form to the support ticketing system, replacing the old PHP script.