Optimize Api Performance
Comprehensive API performance optimization with response time reduction, throughput improvement, and scalability enhancements
$ npx claude-code-templates@latest --command="performance/optimize-api-performance" --yesRequires Claude Code. The command adds this command to your project's .claudedirectory — nothing runs on ToolZip's servers.
What's inside this command
Component source
Optimize API Performance
Analyze and optimize API performance for faster response times, higher throughput, and better scalability: $ARGUMENTS
Instructions
- API Performance Analysis
- Identify slowest endpoints and bottleneck patterns
- Profile API request/response lifecycle and processing time
- Document baseline performance metrics across different load scenarios
- Map API dependency chains and external service calls
- Request/Response Optimization
- Implement efficient response serialization and compression
- Minimize payload sizes through selective field inclusion
- Configure appropriate HTTP headers and caching directives
- Optimize request routing and middleware processing
- Database Query Optimization
- Implement query result caching strategies
- Add appropriate database indexes for API queries
- Optimize database connection pooling and management
- Implement query batching and aggregation where applicable
- Caching Strategy Implementation
- Configure cache invalidation strategies
- Set up API response caching with appropriate TTL values
- Implement cache warming and preloading strategies
- Monitor cache hit ratios and effectiveness
- Rate Limiting and Throttling
- Configure adaptive throttling for different user tiers
- Set up queue management for handling traffic spikes
- Implement circuit breaker patterns for external services
- Monitor and adjust rate limits based on performance metrics
- Concurrency and Parallelization
- Optimize thread pool configuration and management
- Implement parallel processing for independent operations
- Configure connection pooling for optimal concurrency
- Use streaming for large data transfers
- API Gateway and Load Balancing
- Implement health checks and automatic failover
- Set up load balancing algorithms for even traffic distribution
- Configure request/response transformation at gateway level
- Implement API versioning and traffic splitting
- Monitoring and Observability
- Implement distributed tracing for request lifecycle visibility
- Configure performance metrics collection and alerting
- Monitor API error rates and response time percentiles
- Set up real-time performance dashboards
- Security Performance Optimization
- Implement efficient JWT validation and caching
- Configure SSL/TLS termination for optimal performance
- Optimize API key validation and rate limiting
- Implement security middleware performance tuning
- Content Delivery Optimization
- Implement geographic load balancing and edge caching
- Optimize API endpoint geographical distribution
- Set up content compression and optimization
- Configure cache headers for optimal CDN performance
- API Design Optimization
- Implement efficient pagination and filtering strategies
- Optimize API versioning and backward compatibility
- Design APIs for optimal client-side caching
- Implement GraphQL query optimization (if applicable)
- Load Testing and Performance Validation
- Configure performance regression testing in CI/CD
- Set up chaos engineering tests for resilience validation
- Monitor API performance under various load conditions
- Validate performance optimizations with realistic test data
- Scalability Planning
- Implement auto-scaling policies based on performance metrics
- Configure database scaling strategies (read replicas, sharding)
- Plan for traffic growth and capacity requirements
- Implement graceful degradation strategies
- Third-Party Service Optimization
- Implement retry policies and exponential backoff
- Configure timeout settings for external services
- Set up fallback mechanisms for service unavailability
- Monitor third-party service performance impact
- Performance Testing Automation
- Configure performance benchmarking and comparison
- Implement performance regression detection
- Set up load testing in staging environments
- Create performance test data management strategies
Focus on optimizations that provide the highest impact on response times and throughput. Prioritize changes that improve user experience and system scalability while maintaining reliability.
Related Claude Code Commands
Optimize Database Performance
Optimize database queries, indexing, and performance for improved response times and scalability
Performance Audit
Comprehensive performance audit with metrics, bottleneck identification, and optimization recommendations
Optimize Bundle Size
Reduce and optimize bundle sizes through analysis, configuration, and code splitting strategies
Optimize Build
A ready-to-install Claude Code component.
Implement Caching Strategy
Design and implement comprehensive caching solutions for improved performance and scalability
Optimize Memory Usage
Comprehensive memory usage optimization with leak detection, garbage collection tuning, and memory profiling
Catalog data and component content are sourced from the open-source davila7/claude-code-templates project (MIT license). ToolZip curates the listing and writes original descriptions; every component links back to its original source. Claude Code is a product of Anthropic. ToolZip is an independent catalog and is not affiliated with or endorsed by Anthropic.