API-specific response caching policy
You can configure a response caching policy for a managed API. The response caching policy defines how long
API Manager stores API responses in a cache repository.
When response caching is enabled for a managed API,
API Manager saves responses to invocations of the managed API in the cache repository. Responses differ based on the input parameters that the API consumer sends to the API during invocation. When API consumers invoke the managed API,
API Manager attempts to use saved responses in order to reduce time and resources. If a matching response is found in the cache,
API Manager returns the response from the cache instead of calling the Cloud
Application Integration process.
API Manager deletes responses from the cache after the defined timeout. When you disable the response caching policy for a managed API,
API Manager deletes responses from the cache for the managed API.
Before you configure a response caching policy for a managed API, note the following considerations:
- The response cache can store a maximum of 200,000 bytes per API response, and up to 50 responses for a specific managed API.
- You can configure a maximum timeout of 3600 seconds.
- API Manager validates the IP filtering rules and basic authentication policy of the managed API before it stores the responses.
- API Manager stores API responses to GET requests that contain URL query parameters and to POST requests that contain an HTTP request body.
- API Manager stores API responses only to API invocations that return HTTP status code 200 to 299.
- API Manager matches current invocations of the managed API to previous invocations by comparing the query string parameters and the body of the request. It does not match the HTTP headers sent to the API.
- For responses that contain an empty JSON response payload,
API Manager stores the
<jsonObject/> string in the cache instead of the response payload.
- API Manager ignores
Cache-Control directives in response headers. For example, if the response header contains
API Manager ignores it and stores the response in the cache.
- API Manager stores API responses that contain the media types
msWord with media type
application/json. If you download such a response through your browser, the browser doesn't append the appropriate extension to the response. For example, the browser doesn't append the extension
.zip to responses that contain a
zip media type.
- API Manager does not cache images. That is, it doesn't cache responses that contain media types