--- id: TheBeardedBearSAS/claude-craft/edge-computing version: "e3edf908" license: MIT install: manual updated: 2026-07-27 --- # Edge Computing — Edge Computing equips you with patterns and examples for building on Cloudflare Workers, Deno Deploy, Vercel Edge, and Fastly Compute@Edge. Route requests by geography, cache at the edge, run A/B tests, and detect bots—all within strict CPU and memory limits that demand efficient, streaming-first design. Publisher: TheBeardedBearSAS · Stars: 99 · Updated: 2026-07-27 Install (manual): `git clone https://github.com/TheBeardedBearSAS/claude-craft` ## SKILL.md # Edge Computing — Cloudflare Workers, Deno Deploy Compute global faible latence, proche utilisateur. ## Platforms **Cloudflare Workers** — V8, 300+ POPs, KV/Durable **Deno Deploy** — Deno, 30+ POPs, TypeScript **Vercel Edge** — V8, 20+ POPs, Next.js **Fastly Compute@Edge** — WASM, 70+ POPs ## Geo-Routing ```javascript export default { async fetch(req) { const api = req.cf.country === 'US' ? 'us-api' : 'eu-api'; return fetch(`https://${api}.example.com${req.url}`); } }; ``` ## Edge Caching (KV) ```javascript const key = new URL(req.url).pathname; let cached = await env.KV.get(key); if (cached) return new Response(cached, { headers: { 'X-Cache': 'HIT' } }); const resp = await fetch('https://origin.com' + key); const body = await resp.text(); await env.KV.put(key, body, { expirationTtl: 3600 }); return new Response(body, { headers: { 'X-Cache': 'MISS' } }); ``` ## A/B Testing ```javascript const variant = Math.random() < 0.5 ? 'A' : 'B'; resp.cookies.set('ab_test', variant); ``` ## Bot Detection ```javascript if (/bot|crawler/i.test(req.headers.get('User-Agent'))) { return new Response('Forbidden', { status: 403 }); } ``` ## Durable Objects (Stateful) ```javascript export class ChatRoom { async fetch(req) { const [client, server] = Object.values(new WebSocketPair()); this.sessions.push(server); server.accept(); server.on('message', e => this.broadcast(e.data)); return new Response(null, { status: 101, webSocket: client }); } } ``` ## Constraints **CPU** 10-50ms → offload heavy **Memory** 128MB → streaming **No FS** → KV/R2 --- Voir `@.claude/skills/wasm/SKILL.md` [View on SkillFed](https://skillfed.io/TheBeardedBearSAS/claude-craft/edge-computing) · [View on GitHub](https://github.com/TheBeardedBearSAS/claude-craft)