> For the complete documentation index, see [llms.txt](https://clients.medianova.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clients.medianova.com/products/performance-cdn/api-caching.md).

# API Caching

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.

{% hint style="warning" icon="circle-info" %}
For content such as **HTML pages** and other dynamically generated website resources, see[ **Dynamic Content Acceleration**](/products/performance-cdn/dynamic-content-acceleration.md).
{% endhint %}

{% hint style="info" %}
API Caching applies only to responses that can be safely cached. Endpoints containing personalized, transactional, or frequently changing data should generally bypass caching.
{% endhint %}

### 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**](/products/performance-cdn/static-content-delivery.md).

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**](/products/performance-cdn/dynamic-content-acceleration/create-dynamic-resource.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://clients.medianova.com/products/performance-cdn/api-caching.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
