中文
architecture · · 2 min read

Running a Global Bilingual AI Site Matrix on $0/mo: My Cloudflare FinOps Playbook

How radar.aibuildon.com, vps.aibuildon.com, and this AI Lab achieve $0.00/month infrastructure bills through strict static-edge separation, offline LLM pipelines, and Pagefind.

By Hahaxiong
阅读中文原版
Raw .md

TL;DR: Solo builders often rack up USD 40 to 80/month in SSR compute, managed Postgres, and search SaaS bills before validating their first dollar of revenue. By shifting 100% of heavy compute to offline builds and serving pre-rendered pages via Cloudflare Workers Static Assets, you get global sub-20ms latency at strictly USD 0.00/month.

After shipping AI Founder Radar and Global VPS Directory, I built blog.aibuildon.com on the exact same zero-cost foundation to document my AI research, interactive experiments, and indie engineering notes.

1. Front-Store vs. Back-Factory Separation

Most full-stack starters execute Markdown compilation, syntax highlighting, translation lookups, and full-text search queries inside live HTTP handlers. A single traffic spike on Hacker News or X can instantly trip CPU limits or database row quotas.

Instead, we enforce a strict Offline Factory / Static Edge Storefront boundary:

flowchart LR
  A["Local / GitHub Actions Build"] --> B["MDX + KaTeX + Expressive Code"]
  A --> C["SHA-256 Incremental ZH -> EN Check"]
  B --> D["Pagefind Static Search Shards"]
  D --> E["Cloudflare Workers Static Assets"]
  E --> F["Global Edge Delivery (0ms Worker CPU)"]
Figure 1: Zero-runtime-compute build and edge delivery pipeline

2. Simulating Free-Tier Quotas Under Traffic Spikes

When requests are served directly by Cloudflare Workers Static Assets, daily billed Worker invocations RworkerR_{\text{worker}} as a function of daily pageviews VdailyV_{\text{daily}} follow:

Rworker=Vdaily×(1−ηstatic)R_{\text{worker}} = V_{\text{daily}} \times (1 - \eta_{\text{static}})

With pure static delivery (ηstatic=1.0\eta_{\text{static}} = 1.0), Rworker≡0R_{\text{worker}} \equiv 0 regardless of traffic bursts. Drag the slider in the embedded Preact Island below to compare resource consumption:

Interactive Preact Island · 0 Backend Calls

Traffic Spike Simulator: Static Edge vs Dynamic SSR Monthly Bill

Simulated Daily Pageviews50,000 PV / day
Daily Worker Quota Used
0 (0%)
Search & Comment DB Reads
0 rows (GitHub + Static)
Estimated Monthly Bill
$0.00 / mo

3. Pure Static Assets Configuration

Without dynamic backend routes, wrangler.jsonc does not even require a main Worker entrypoint—Cloudflare serves ./dist natively at the edge:

wrangler.jsonc
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "blog-aibuildon",
"compatibility_date": "2026-11-29",
"routes": [
{ "pattern": "blog.aibuildon.com", "custom_domain": true }
],
"assets": {
"directory": "./dist",
"not_found_handling": "404-page"
}
}

Whenever an interactive AI tool needs a server-side API key in the future, we simply attach Hono with narrow run_worker_first: ["/api/*"] routing while keeping 99.9% of traffic free.

4. Dual Surfaces for Humans and LLMs

Modern technical blogs are read by both engineers and AI agents:

  1. One-Click Markdown Twins: Every essay exposes a clean .md endpoint and clipboard button for instant LLM context feeding.
  2. Native llms.txt Corpus: Generated at build time so AI search engines index accurate primary sources.
  3. Zero-DB Discussions via Giscus: Backed by GitHub Discussions with lazy IntersectionObserver loading—zero spam maintenance and zero D1 row consumption.
#cloudflare #astro #finops #ai-infra

Discussion & Comments

Powered by GitHub Discussions (Giscus) · Zero DB Overhead · Markdown Supported