skills/api-response-optimization/SKILL.md
Optimize API response times through caching, compression, and efficient payloads. Improve backend performance and reduce network traffic.
npx skillsauth add aj-geddes/useful-ai-prompts api-response-optimizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 |
development
Implement Zero Trust security model with identity verification, microsegmentation, least privilege access, and continuous monitoring. Use when building secure cloud-native applications.
development
Prevent Cross-Site Scripting (XSS) attacks through input sanitization, output encoding, and Content Security Policy. Use when handling user-generated content in web applications.
tools
Create wireframes and interactive prototypes to visualize user interfaces and gather feedback early. Use tools and techniques to communicate design ideas before development.
development
Implement real-time bidirectional communication with WebSockets including connection management, message routing, and scaling. Use when building real-time features, chat systems, live notifications, or collaborative applications.