💨

API Caching Strategy

Verified

by Community

Designs HTTP caching strategies for APIs using Cache-Control headers, ETags, conditional requests, and CDN integration. Covers cache invalidation patterns, stale-while-revalidate, and caching strategies for authenticated and personalized content.

cachinghttpapiperformancecdn

API Caching Strategy

Implement effective HTTP caching strategies for API responses with proper headers and invalidation patterns.

Usage

Describe your API endpoints and caching requirements, and this skill will design the caching strategy.

Examples

  • "Set up HTTP caching for my product catalog API"
  • "Implement ETags for conditional requests on user profile endpoints"
  • "Design a cache invalidation strategy for a content management API"

Guidelines

  • Use Cache-Control headers appropriate to each endpoint's freshness needs
  • Implement ETags for efficient conditional requests
  • Use stale-while-revalidate for non-critical data freshness
  • Cache public data at the CDN level for global performance
  • Never cache authenticated or personalized responses in shared caches