know.2nth.ai Technology tech cloudflare Pages
Technology · Cloudflare · Skill Node

Cloudflare
Pages.

Git-driven static hosting with edge Functions baked in. Connect a repo, get global deploys with preview URLs per pull request and zero infrastructure to manage. This site runs on it.

Technology Static + Functions Open Tier Last updated · Apr 2026

A static site host that grows into a full-stack deploy surface.

Pages is Cloudflare's Jamstack hosting platform. You point it at a GitHub or GitLab repo, pick your build command, and Cloudflare builds your site and distributes the output across 330+ edge locations. Every push to your production branch deploys globally; every pull request gets a unique preview URL.

The trick is Functions. Drop a file under functions/ and it compiles into a Worker route on the same deploy. You get server-side logic — form handlers, API proxies, auth checks — without leaving the Pages deploy pipeline. For teams that start with a marketing site and grow into an app, this is the ramp.

Pages also supports direct uploads via Wrangler for teams that want their own CI. The build pipeline is optional; the edge distribution is not.

Git push to global deploy in under a minute.

01

Build configuration

Pages needs a build command and an output directory. For most frameworks this is auto-detected. You can also set environment variables and Node version in the dashboard or via wrangler.toml.

# wrangler.toml — Pages project
name = "my-site"
pages_build_output_dir = "./dist"

# Compatibility flags for Functions
compatibility_date = "2024-09-01"

[[kv_namespaces]]
binding = "CACHE"
id = "abc123..."
02

Functions: Workers inside Pages

Any file in functions/ maps to a route. functions/api/submit.ts becomes /api/submit. You get the same Workers API — env bindings, request.cf geolocation, waitUntil — without a separate wrangler project.

// functions/api/subscribe.ts
export const onRequestPost: PagesFunction<Env> = async (ctx) => {
  const { email } = await ctx.request.json();
  await ctx.env.DB.prepare(
    "INSERT INTO subscribers (email) VALUES (?)"
  ).bind(email).run();
  return Response.json({ ok: true });
};
03

Preview deployments

Every non-production branch gets its own URL: <branch>.<project>.pages.dev. PRs get a unique preview. QA, stakeholder review, and design feedback happen on live URLs without touching production. This is the feature teams actually love.

# Deploy via Wrangler (direct upload, skipping CI)
npx wrangler pages deploy ./dist --project-name my-site

# Preview a branch
npx wrangler pages deploy ./dist \
  --project-name my-site \
  --branch feature/new-nav

Where it bites you in production.

Build limits

500 builds per month on free

Active repos with frequent pushes burn through this fast. Move to Wrangler direct upload if your CI already builds the site, or upgrade to Pro for 5,000 builds.

Functions cold path

Functions are Workers with extra routing overhead

Pages Functions add a routing layer on top of Workers. For latency-critical APIs, a standalone Worker with custom routes can shave a few milliseconds.

File count limits

20,000 files per project

Large doc sites or monorepos with generated assets can hit this. If you're close, split into multiple Pages projects behind a single domain with Workers routes.

Binding config

Dashboard vs wrangler.toml confusion

Pages bindings historically lived only in the dashboard. Now wrangler.toml works too, but mixing the two is a source of "works locally, broken in prod" bugs. Pick one.

When it fits. When it doesn't.

✓ Use it when
  • You want git-push deploys with zero infra. Connect a repo and walk away. CI, preview URLs, and global distribution are built in.
  • Static site + a handful of dynamic endpoints. The Functions model is perfect for contact forms, webhooks, and light APIs alongside static content.
  • You need preview URLs per PR. Every branch gets a live URL. Stakeholder feedback loops collapse from days to minutes.
  • Your team is already on Cloudflare. Pages shares the same bindings, DNS, and Access rules as the rest of the platform.

Where this node connects.

Go deeper.