api-response-optimization

Optimizes API performance through payload reduction, caching strategies, and compression techniques. Use when improving API response times, reducing bandwidth usage, or implementing efficient caching.

16 stars

Best use case

api-response-optimization is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Optimizes API performance through payload reduction, caching strategies, and compression techniques. Use when improving API response times, reducing bandwidth usage, or implementing efficient caching.

Teams using api-response-optimization should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/api-response-optimization/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/api-response-optimization/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/api-response-optimization/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How api-response-optimization Compares

Feature / Agentapi-response-optimizationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Optimizes API performance through payload reduction, caching strategies, and compression techniques. Use when improving API response times, reducing bandwidth usage, or implementing efficient caching.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# API Response Optimization

Reduce payload sizes, implement caching, and enable compression for faster APIs.

## Sparse Fieldsets

```javascript
// 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

```javascript
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

```javascript
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

| Metric | Target |
|--------|--------|
| 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

generative-optimization

16
from diegosouzapw/awesome-omni-skill

Expert guidance for solving optimization problems using generative models (GMM and Flow Matching). Use when users need to solve optimization, inverse problems, or find feasible solutions under constraints using probabilistic sampling approaches.

u09613-writing-and-rhetoric-optimization-for-household-logistics

16
from diegosouzapw/awesome-omni-skill

Operate the "Writing And Rhetoric Optimization for household logistics" capability in production for household logistics workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.

asset-optimization

16
from diegosouzapw/awesome-omni-skill

Asset optimization skill for mesh and texture budgets.

grey-haven-seo-geo-optimization

16
from diegosouzapw/awesome-omni-skill

Use when optimizing web content for search engine visibility, improving AI search engine citations (GEO), auditing website SEO, implementing structured data markup, or researching keyword strategy. Triggers: 'SEO', 'GEO', 'search optimization', 'schema markup', 'meta tags', 'AI search', 'Perplexity', 'search rankings', 'structured data', 'generative engine optimization', 'rich results', 'robots.txt', 'sitemap'.

sql-optimization-patterns

16
from diegosouzapw/awesome-omni-skill

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database...

readability-optimization

16
from diegosouzapw/awesome-omni-skill

Analyze and improve text readability using Flesch-Kincaid scores, sentence length, paragraph density, and plain language techniques. Use this skill when reviewing or editing existing text for clarity.

PostgreSQL Performance Optimization

16
from diegosouzapw/awesome-omni-skill

Production-grade PostgreSQL query optimization, indexing strategies, performance tuning, and modern features including pgvector for AI/ML workloads. Master EXPLAIN plans, query analysis, and database design for high-performance applications

postgresql-optimization

16
from diegosouzapw/awesome-omni-skill

PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

Incident Response

16
from diegosouzapw/awesome-omni-skill

Incident response is a systematic approach to handling security breaches and incidents to minimize damage, reduce recovery time, and prevent future occurrences. Effective incident response includes pr

database-advanced-optimization

16
from diegosouzapw/awesome-omni-skill

Use SQL (PostgreSQL) when:

dan_dual_response_simulation

16
from diegosouzapw/awesome-omni-skill

Simulate an unrestricted AI (DAN) alongside a standard AI, providing dual responses with mode-switching capabilities and matching the user's language.

Conversion Optimization

16
from diegosouzapw/awesome-omni-skill

Conversion Rate Optimization (CRO) is the systematic process of increasing the percentage of website or app visitors who complete a desired action (conversion) through data-driven experimentation and