Edge Intelligence
Cloudflare attaches datacenter metadata to every request at the edge. Zero API calls — it's in request.cf. You're being served from the datacenter below.
Global Counter
Atomic KV increment on every pageview. KV is eventually consistent — reads propagate across 300+ edge locations within ~60 seconds. The KV operation itself at the edge is sub-millisecond.
Database at the Edge
Full SQLite at Cloudflare's edge. 5M reads + 100K writes/day free. Relationships, indexes, aggregate queries — all working. 3-table schema with seed data that survives daily wipe.
Edge Cache Demo
Click once → cache miss, queries D1 (slow). Click again within 60s → cache hit, served from KV (fast). The timing delta proves why caching matters at the edge.
Strong Consistency
One globally-coordinated object with its own SQLite storage. Unlike the KV counter (eventually consistent, ~60s to propagate), every increment here is strongly consistent — serialized through a single object, read-your-writes instantly.
LLM Inference
Llama 3.1 8B running at the edge via an AI binding. No GPU provisioning, no model deployment — just a binding call.
Image Generation
Text-to-image at the edge with FLUX.1 [schnell], a 12B-parameter model from Black Forest Labs. Same AI binding as the LLM — no GPUs to manage. Draws on the daily free Neuron allowance.
Object Storage — Zero Egress
S3-compatible object storage. Upload is Turnstile-gated and capped at 500KB. User uploads are prefixed upload- and wiped regularly. Demo images (prefixed demo-) persist across wipes. Each upload is auto-captioned and safety-screened by a vision model (LLaVA via Workers AI) — offensive images are rejected; captions are stored in R2 metadata and shown on hover.
Drop an image or click to browse
JPEG · PNG · GIF · WebP · max 500KB · wiped nightly
Free Tier Headroom today's usage vs. daily limits
Architecture
Browser ──── Cloudflare Edge Network (300+ global PoPs)
│
├── / ──→ Pages (static assets, global CDN, zero config)
│
├── /api/geo ──→ Workers → request.cf (edge metadata, no DB)
├── /api/counter ──→ Workers → KV (global visit counter)
├── /api/guestbook ──→ Workers → D1 + Turnstile
├── /api/d1/stats ──→ Workers → D1 (GROUP BY, COUNT, AVG)
├── /api/d1/search ──→ Workers → D1 (LIKE full-text search)
├── /api/d1/semantic ──→ Workers → Workers AI (embed) → Vectorize (kNN) → D1
├── /api/d1/posts ──→ Workers → D1 (JOIN posts ↔ tags)
├── /api/kv/cache ──→ Workers → KV ──(hit)──→ return cached
│ └─(miss)──→ D1 → KV.put
├── /api/do/counter ──→ Workers → Durable Object (strongly-consistent, separate Worker)
├── /api/ai/generate ──→ Workers → Workers AI (Llama 3.1 8B Instruct)
├── /api/ai/image ──→ Workers → Workers AI (FLUX.1 schnell text-to-image)
├── /api/r2/upload ──→ Workers → R2 + Turnstile + Workers AI (caption + moderation)
├── /api/r2/list ──→ Workers → R2 (list + metadata)
├── /api/r2/file/:key ──→ Workers → R2 (stream with etag)
├── /api/stats ──→ Workers → D1 + KV + R2 (aggregate dashboard)
├── /api/admin/reindex ──→ Workers → Workers AI (embed) → Vectorize (upsert)
└── /api/admin/wipe ──→ Workers → D1 + R2 + KV (wipe + re-seed)
↑
Schedule via standalone Worker cron
or external service (e.g. cron-job.org)
Expression: 0 0 * * * (midnight UTC daily)