edge-computing-patternslisted
Install: claude install-skill aiskillstore/marketplace
# Edge Computing Patterns
## Overview
Edge computing runs code closer to users worldwide, reducing latency from seconds to milliseconds. This skill covers Cloudflare Workers, Vercel Edge Functions, and Deno Deploy patterns for building globally distributed applications.
**When to use this skill:**
- Global applications requiring <50ms latency
- Authentication/authorization at the edge
- A/B testing and feature flags
- Geo-routing and localization
- API rate limiting and DDoS protection
- Transforming responses (image optimization, HTML rewriting)
## Platform Comparison
| Feature | Cloudflare Workers | Vercel Edge | Deno Deploy |
|---------|-------------------|-------------|-------------|
| Cold Start | <1ms | <10ms | <10ms |
| Locations | 300+ | 100+ | 35+ |
| Runtime | V8 Isolates | V8 Isolates | Deno |
| Max Duration | 30s (paid: unlimited) | 25s | 50ms-5min |
| Free Tier | 100k req/day | 100k req/month | 100k req/month |
## Cloudflare Workers
```typescript
// worker.ts
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const url = new URL(request.url)
// Geo-routing
const country = request.cf?.country || 'US'
if (url.pathname === '/api/hello') {
return new Response(JSON.stringify({
message: `Hello from ${country}!`
}), {
headers: { 'Content-Type': 'application/json' }
})
}
// Cache API
const cache = caches.default
let response = await cache.match(request)
if (!resp