API Response Optimization

API Response Optimization

Guides an AI agent to speed up API responses through caching, compression and lean payloads, reducing server load and network traffic.

Skill files7 files

references/

scripts/

templates/

SKILL.md88 lines
1
---
2
name: api-response-optimization
3
description: >
4
Optimize API response times through caching, compression, and efficient
5
payloads. Improve backend performance and reduce network traffic.
6
---
7
8
# API Response Optimization
9
10
## Table of Contents
11
12
- [Overview](#overview)
13
- [When to Use](#when-to-use)
14
- [Quick Start](#quick-start)
15
- [Reference Guides](#reference-guides)
16
- [Best Practices](#best-practices)
17
18
## Overview
19
20
Fast API responses improve overall application performance and user experience. Optimization focuses on payload size, caching, and query efficiency.
21
22
## When to Use
23
24
- Slow API response times
25
- High server CPU/memory usage
26
- Large response payloads
27
- Performance degradation
28
- Scaling bottlenecks
29
30
## Quick Start
31
32
Minimal working example:
33
34
```javascript
35
// Inefficient response (unnecessary data)
36
GET /api/users/123
37
{
38
"id": 123,
39
"name": "John",
40
"email": "john@example.com",
41
"password_hash": "...", // ❌ Should never send
42
"ssn": "123-45-6789", // ❌ Sensitive data
43
"internal_id": "xyz",
44
"created_at": "2024-01-01T00:00:00Z",
45
"updated_at": "2024-01-02T00:00:00Z",
46
"meta_data": {...}, // ❌ Unused fields
47
"address": {
48
"street": "123 Main",
49
"city": "City",
50
"state": "ST",
51
"zip": "12345",
52
"geo": {...} // ❌ Not needed
53
}
54
}
55
56
// Optimized response (only needed fields)
57
GET /api/users/123
58
{
59
"id": 123,
60
// ... (see reference guides for full implementation)
61
```
62
63
## Reference Guides
64
65
Detailed implementations in the `references/` directory:
66
67
| Guide | Contents |
68
|---|---|
69
| [Response Payload Optimization](references/response-payload-optimization.md) | Response Payload Optimization |
70
| [Caching Strategies](references/caching-strategies.md) | Caching Strategies |
71
| [Compression & Performance](references/compression-performance.md) | Compression & Performance |
72
| [Optimization Checklist](references/optimization-checklist.md) | Optimization Checklist |
73
74
## Best Practices
75
76
### ✅ DO
77
78
- Follow established patterns and conventions
79
- Write clean, maintainable code
80
- Add appropriate documentation
81
- Test thoroughly before deploying
82
83
### ❌ DON'T
84
85
- Skip testing or validation
86
- Ignore error handling
87
- Hard-code configuration values
88

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…