From aj-geddes-useful-ai-prompts-4
Optimize API response times through caching, compression, and efficient payloads. Improve backend performance and reduce network traffic.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:api-response-optimizationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Fast API responses improve overall application performance and user experience. Optimization focuses on payload size, caching, and query efficiency.
Minimal working example:
// Inefficient response (unnecessary data)
GET /api/users/123
{
"id": 123,
"name": "John",
"email": "[email protected]",
"password_hash": "...", // ❌ Should never send
"ssn": "123-45-6789", // ❌ Sensitive data
"internal_id": "xyz",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-02T00:00:00Z",
"meta_data": {...}, // ❌ Unused fields
"address": {
"street": "123 Main",
"city": "City",
"state": "ST",
"zip": "12345",
"geo": {...} // ❌ Not needed
}
}
// Optimized response (only needed fields)
GET /api/users/123
{
"id": 123,
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Response Payload Optimization | Response Payload Optimization |
| Caching Strategies | Caching Strategies |
| Compression & Performance | Compression & Performance |
| Optimization Checklist | Optimization Checklist |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Optimizes API responses via sparse fieldsets for payload reduction, ETag caching headers, and compression middleware. Use for improving response times, reducing bandwidth, and efficient caching in Node.js apps.
Implements HTTP caching strategies including Cache-Control directives, ETags, conditional requests, CDN caching for APIs, response compression (gzip/Brotli), HTTP/2, and circuit breakers.
Implements caching strategies with Redis, Memcached, and CDN. Covers cache invalidation patterns, TTL management, and multi-level caching for performance optimization.