For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Caching

Learn how API Caching stores cacheable API responses at the CDN edge to reduce latency, improve scalability, and decrease origin load.

API Caching stores cacheable API responses on CDN edge servers, allowing repeated requests to be served without contacting the origin. This reduces response times and backend processing for APIs that return identical responses to multiple clients.

API Caching applies only to responses that can be safely cached. Endpoints containing personalized, transactional, or frequently changing data should generally bypass caching.

Understanding API Caching

Unlike static assets, API responses are typically generated by backend services. However, many APIs produce identical responses for multiple requests during short time periods.

API Caching allows these responses to be temporarily stored at the CDN edge and reused until the configured cache policy expires.

For static assets such as images, CSS, JavaScript, fonts, and downloadable files, see Static Content Delivery.

Typical examples include:

  • Product catalogs

  • Public content APIs

  • Exchange rates

  • News feeds

  • Search suggestions

  • Configuration endpoints

How API Caching works

  1. A client sends a request to an API endpoint.

  2. The request reaches the nearest Medianova edge server.

  3. The CDN checks whether a valid cached response exists.

  4. If a cache hit occurs, the cached response is returned immediately.

  5. Otherwise, the request is forwarded to the origin.

  6. The origin response is cached according to the configured cache policy.

  7. Subsequent matching requests are served from the CDN until the cached response expires.

Benefits

API Caching can help:

  • Reduce response latency

  • Decrease origin requests

  • Lower backend processing

  • Improve scalability during traffic spikes

  • Increase cache efficiency for repetitive requests

When to use API Caching

API Caching is well suited for:

  • Read-heavy APIs

  • Frequently requested public data

  • Responses that change at predictable intervals

  • High-volume endpoints shared by many users

Avoid caching:

  • Authentication endpoints

  • Checkout workflows

  • User-specific responses

  • Session-dependent APIs

  • Real-time transactional operations

To configure API caching behavior for a CDN Resource, see Dynamic CDN Resource.

Last updated

Was this helpful?