
Cloudflare Workers Performance
This covers the core performance bottlenecks you'll hit with Cloudflare Workers: CPU limits, cold starts, memory pressure, and caching. It's packed with before/after code showing what actually slows things down (unnecessary cloning, buffering entire responses, missing cache layers) and how to fix it. The profiling middleware is genuinely useful for finding hot paths, and the multi-layer caching strategy (memory, Cache API, KV) is solid. Best part is the table mapping errors to fixes, because "CPU limit exceeded" is useless without knowing whether to stream, batch, or optimize your JSON parsing. Aimed at people already hitting performance walls rather than premature optimization.
- skills.sh installs
- 329
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill cloudflare-workers-performance --agent claude-codeInstalls into .claude/skills of the current project.
Files
Cloudflare Workers Performance Optimization
Techniques for maximizing Worker performance and minimizing latency.
Quick Wins
// 1. Avoid unnecessary cloning
// ❌ Bad: Clones entire request
const body = await request.clone().json();
// ✅ Good: Parse directly when not re-using body
const body = await request.json();
// 2. Use streaming instead of buffering
// ❌ Bad: Buffers entire response
const text = await response.text();
return new Response(transform(text));
// ✅ Good: Stream transformation
return new Response(response.body.pipeThrough(new TransformStream({
transform(chunk, controller) {
controller.enqueue(process(chunk));
}
})));
// 3. Cache expensive operations
const cache = caches.default;
const cached = await cache.match(request);
if (cached) return cached;
Critical Rules
- Stay under CPU limits - 10ms (free), 30ms (paid), 50ms (unbound)
- Minimize cold starts - Keep bundles < 1MB, avoid dynamic imports
- Use Cache API - Cache responses at the edge
- Stream large payloads - Don't buffer entire responses
- Batch operations - Combine multiple KV/D1 calls
Top 10 Performance Errors
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Debugging, Cloud & Infrastructure
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Bun Hot Reloading328
- Bun Redis328
- Bun Ffi326
- Bun Jest Migration326
- Bun Websocket Server326
- Cloudflare Workers Runtime Apis326
- Swift Best Practices326
- Bun Nuxt323
- Bun Macros322
- Cloudflare Workers Frameworks321
- Supabase Postgres Best Practices319
- Cloudflare Workers Ci Cd318
- Cloudflare Workers Dev Experience317
- Cloudflare Workers Observability315
- Cloudflare Workers Migration310
- Cloudflare Workers Multi Lang310
- Verification Before Completion310
- Nuxt Studio308
- Neon Vercel Postgres294
- Chrome Devtools288
- Database Sharding277
- Sveltia Cms277
- Google Gemini File Search272
- Tailwind V4 Shadcn8.2K