Api Response Optimization
Practical API response optimization covering sparse fieldsets, HTTP caching headers, and response compression for faster, lighter endpoints.
- CCM score
- 52 of 100
- skills.sh installs
- 442
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers payload reduction, ETag-based HTTP caching, and gzip or brotli response compression for Express-style APIs
- Includes JavaScript examples for
?fields=sparse fieldsets, 304 conditional responses, andcompressionmiddleware with a per-request opt-out - Sets performance targets of under 100ms response time, under 50KB payloads, and under 30% server CPU
- Provides a checklist covering field removal, pagination, N+1 query prevention, and APM monitoring, plus caching rules for immutable and frequently changing data
Install
$ npx -y skills add secondsky/claude-skills --skill api-response-optimization -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
API Response Optimization
Reduce payload sizes, implement caching, and enable compression for faster APIs.
Sparse Fieldsets
// Allow clients to select fields: GET /users?fields=id,name,email
app.get('/users', async (req, res) => {
const fields = req.query.fields?.split(',') || null;
const users = await User.find({}, fields?.join(' '));
res.json(users);
});
HTTP Caching Headers
app.get('/products/:id', async (req, res) => {
const product = await Product.findById(req.params.id);
const etag = crypto.createHash('md5').update(JSON.stringify(product)).digest('hex');
if (req.headers['if-none-match'] === etag) {
return res.status(304).end();
}
res.set({
'Cache-Control': 'public, max-age=3600',
'ETag': etag
});
res.json(product);
});
Response Compression
const compression = require('compression');
app.use(compression({
filter: (req, res) => {
if (req.headers['x-no-compression']) return false;
return compression.filter(req, res);
},
level: 6 // Balance between speed and compression
}));
Performance Targets
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, Code Review & Quality
- First seen
- Jun 3, 2026
Questions
What does the api-response-optimization skill do?
The api-response-optimization skill reduces API payload sizes, adds HTTP caching with ETag and Cache-Control headers, and enables response compression. It is meant for improving API response times, reducing bandwidth usage, and setting up efficient caching in an API.
How do I install the api-response-optimization skill?
Run npx -y skills add secondsky/claude-skills --skill api-response-optimization -y in a project to install api-response-optimization. Once installed, the skill gives your agent guidance on sparse fieldsets, ETag caching and gzip or brotli compression.
Where does api-response-optimization stand in the Backend & APIs category?
api-response-optimization is listed under Backend & APIs on Claude Marketplaces, next to entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. It sets itself apart by focusing on payload reduction, HTTP caching headers and compression rather than on a single platform.
Which performance targets does api-response-optimization suggest?
api-response-optimization gives targets of under 100ms response time, down from 500ms, payloads under 50KB, down from 500KB, and server CPU under 30%, down from 80%. It also includes a checklist covering sparse fieldsets, ETag headers, compression, pagination and N+1 query prevention.
More from secondsky/claude-skills
All 116- Api Filtering Sorting440
- Bun Drizzle Integration440
- Defense In Depth Validation439
- Session Management438
- Bun Runtime437
- Nuxt Production434
- Ultracite434
- Bun Docker433
- Bun Tanstack Start433
- Api Gateway Configuration430
- Nuxt Ui V4430
- Oauth Implementation430
- Bun Test Mocking429
- Health Check Endpoints429
- Bun Test Coverage426
- Mobile Offline Support425
- Nuxt Server425
- Api Changelog Versioning424
- Bun Cloudflare Workers424
- Bun Workers424
- Dependency Upgrade424
- Idempotency Handling424
- Bun Http Server423
- Bun Bundler422
Similar to Api Response Optimization
More Backend & APIsapi-rate-limitingsecondsky/claude-skills517 installsPractical rate limiting that compares token bucket, sliding window, and fixed window approaches for protecting public APIs.
rest-api-designsecondsky/claude-skills609 installsOpinionated REST conventions covering naming, HTTP methods, status codes, and response envelopes for new APIs.
caching-cdn-strategy-plannerpatricio0312rev/skills263 installsMulti-layer caching strategy covering CDN edge, Redis server cache, invalidation, and HTTP cache headers.
caching-strategyaj-geddes/useful-ai-prompts552 installsCache design guide covering Redis, Memcached, CDN, and invalidation patterns for faster responses and lower database load.
compressionpatternsdev/skills1.7K installsReference guide to JavaScript compression with Gzip and Brotli, covering static versus dynamic server-side setups.
fastify-best-practicesmcollina/skills108.7K installsComprehensive Fastify backend guide covering routes, plugins, schemas, auth, performance, and production deployment.