Optimize API response times through caching, compression, and efficient payloads. Improve backend performance and reduce network traffic.
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": "john@example.com",
"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 |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/api-response-optimization · pinned to the source commit
# Run from your project root
git clone https://github.com/aj-geddes/useful-ai-prompts.git .skillboard-tmp
git -C .skillboard-tmp checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/skills/api-response-optimization" ".claude/skills/"
rm -rf .skillboard-tmpReview the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
sudo apt update && sudo apt install -y gitnpm install -g @anthropic-ai/claude-code# Run from your project root
git clone https://github.com/aj-geddes/useful-ai-prompts.git .skillboard-tmp
git -C .skillboard-tmp checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/skills/api-response-optimization" ".claude/skills/"
rm -rf .skillboard-tmpDestination: .claude/skills/api-response-optimization
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
References credentials, tokens or secret files that a skill should not need.
Evidence: [redacted]· fingerprint 5e884898da280471