Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
secondsky avatar

Api Response Optimization

  • 330 installs
  • 202 repo stars
  • Updated August 4, 2026
  • secondsky/claude-skills

api-response-optimization is an MIT-licensed Claude agent skill that optimizes API performance through sparse fieldsets, HTTP caching headers, and compression techniques for developers reducing response times and bandwid

About

api-response-optimization is a secondsky/claude-skills MIT-licensed agent skill for making REST and Node.js APIs faster and leaner. It implements sparse fieldsets so clients request only needed columns via query parameters such as GET /users?fields=id,name,email, configures HTTP caching headers with ETag and Cache-Control patterns, and enables compression to cut payload sizes on the wire. Developers invoke api-response-optimization when improving API response times, reducing bandwidth usage, or implementing efficient caching for mobile and web clients hitting high-traffic endpoints. The skill includes concrete Express-style handler examples for field projection, cache validation, and gzip-compatible response paths rather than abstract performance advice. Reach for api-response-optimization during backend build when latency regressions trace to overweight JSON payloads or missing cache headers on read-heavy routes. Outputs are optimized route handlers and caching configuration ready for load testing.

  • api-response-optimization

Api Response Optimization by the numbers

  • 330 all-time installs (skills.sh)
  • +13 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #1,261 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/secondsky/claude-skills --skill api-response-optimization

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs330
repo stars202
Last updatedAugust 4, 2026
Repositorysecondsky/claude-skills

How do you optimize API response size and caching?

Use api-response-optimization for development tasks

Who is it for?

Backend developers tuning read-heavy REST or Node.js APIs where overweight JSON payloads and missing cache headers cause latency regressions.

Skip if: Teams optimizing database query plans or CDN edge configuration without changing application-level API response shaping code.

When should I use this skill?

A developer asks to improve API response times, reduce bandwidth usage, implement sparse fieldsets, or add HTTP caching and compression to endpoints.

What you get

Optimized API route handlers with sparse fieldsets, ETag and Cache-Control headers, and compression configuration for reduced latency and bandwidth.

  • Optimized route handlers
  • Caching header configuration
  • Sparse fieldset query support

By the numbers

  • MIT license

Files

SKILL.mdMarkdownGitHub ↗

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

MetricTarget
Response time<100ms (from 500ms)
Payload size<50KB (from 500KB)
Server CPU<30% (from 80%)

Optimization Checklist

  • [ ] Remove sensitive/unnecessary fields from responses
  • [ ] Implement sparse fieldsets
  • [ ] Add ETag/Last-Modified headers
  • [ ] Enable gzip/brotli compression
  • [ ] Use pagination for collections
  • [ ] Eager load to prevent N+1 queries
  • [ ] Monitor with APM tools

Best Practices

  • Cache immutable resources aggressively
  • Use short TTL for frequently changing data
  • Invalidate cache on writes
  • Compress responses >1KB
  • Profile before optimizing

Related skills

How it compares

Use api-response-optimization for handler-level payload and cache tuning; use database indexing skills when bottlenecks are query plans not JSON response size.

FAQ

What techniques does api-response-optimization use?

api-response-optimization applies sparse fieldsets for client-selected columns, HTTP caching headers including ETag and Cache-Control, and compression for smaller payloads. The MIT-licensed secondsky/claude-skills entry includes Express handler patterns for field projection and c

When should developers invoke api-response-optimization?

Developers should invoke api-response-optimization when improving API response times, reducing bandwidth, or implementing efficient caching on read-heavy endpoints. The skill targets backend handler changes rather than database index tuning or CDN-only optimizations.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.