Skip to content

Cloudflare Pages

Cloudflare’s static-site hosting service. The page you’re reading right now is served by Cloudflare Pages.

One Pages project: agent-platform-docs. Hosts the apps/docs/ directory’s build output (Astro + Starlight static site). Served from Cloudflare’s edge worldwide.

Two deploy modes are available:

  • Manualwrangler pages deploy ./dist from a local build
  • Git-driven (recommended) — point Pages at the agent-platform repo, set the build command to pnpm --filter @agent-platform/docs build, and every push to main triggers a deploy with a unique URL. PRs get preview URLs automatically.

No Worker, no D1, no functions. Pure static HTML/CSS/JS.

The choice was: where do we host the docs site?

OptionVerdict
Cloudflare PagesChosen. Pages is purpose-built for static sites; git-driven deploys + preview URLs out of the box; same account as the rest of the stack.
GitHub PagesFree, but gives up the unified Cloudflare-account story we tell investors.
Vercel / NetlifyStrong alternatives but introduce a third vendor for documentation alone.
A second Cloudflare WorkerPossible — Workers can serve static assets — but Pages is the right tool for the job. Reaching for a Worker would be reinventing what Pages already does.
Self-hosted (S3 + CloudFront, etc.)Significant setup for no benefit.

Pages won as the obvious fit. We considered serving the docs from a Worker briefly (the platform Worker isn’t a docs server, but a dedicated docs Worker would be); decided against it because docs are pure static content and Pages is the purpose-built service.

Cloudflare Pages free tier:

  • Unlimited sites
  • Unlimited requests
  • 500 builds per month
  • 100 custom domains per project

Phase 1’s docs site uses ~5 builds per week. Free tier covers us indefinitely at this rate.

A documentation host like Read the Docs, GitBook, Confluence, or a self-hosted Hugo deploy. Pages reduces this to a wrangler.jsonc file + the build output directory.

  • apps/docs/wrangler.jsonc — Pages deploy config (very small)
  • apps/docs/astro.config.mjs — Astro + Starlight site config
  • apps/docs/src/content/docs/ — the markdown content tree
  • apps/docs/README.md — local-dev + deploy runbook
  • Pure static. No server-side rendering, no API routes, no per-visitor personalization. This is fine; docs don’t need any of those. If we ever need a “try it” widget that talks to the platform Worker, the widget runs client-side and hits the platform Worker’s public URL.
  • Build-time only. Content updates require a rebuild (~22 seconds). For a docs site this is fine. For a high-frequency- update scenario (a status page, a live dashboard) this would be wrong.
  • No git LFS for large media. Pages builds from the git repo’s contents; very large binaries (videos, big PNGs) would inflate clone times. We keep media small or move it to R2 if needed.