API caching

API caching refers to the caching instructions that you set for your entire API. By default, the settings that you configure at this level apply to all resources associated with your API. If desired, API Gateway lets you further customize the downstream and resource-level caching settings.

Note: This section explains the concept of API caching. For specific steps to configure API caching in API Gateway, see Configure caching.

You can implement one of the following caching options for your API:

Cache
Enable caching of your API content in Akamai platform servers. This allows you to set the maximum time for keeping content in the edge server cache and specify whether to serve stale cached objects to clients when your origin is unavailable.
No store
Disallow caching in Akamai platform servers and remove any existing cache entries from the edge server cache. This option turns off caching of your API content entirely.
Bypass cache
Disallow caching in Akamai platform servers and keep the existing cache entries. You can choose this option if you expect your origin server to send alternate responses to clients. Consider the example of an origin server sending a 302 redirect in response to a failed authorization. By using the Bypass cache option, you prevent this alternate response from removing the requested object from edge server cache.
Honor origin Cache-Control
Apply caching instructions as specified in your origin's Cache-Control header. Edge servers can honor the following settings from the Cache-Control header: max-age, no-store, no-cache (behaves like setting a zero second max-age), pre-check (serves as a max-age setting if there is no max-age), post-check (serves as an edge prefresh settings).
Honor origin Expires
Apply caching instructions as specified in your origin's Expires header. Based on the value in the Expires header, edge servers calculate an implied max age for keeping content in a cache. The implied max age is equal to the origin Expires date minus the origin current date. You can use this option if you expect the objects returned from your origin to change at a specific time.
Honor origin Cache-Control and Expires
Apply caching instructions specified in your origin's Cache-Control and Expires headers. In case of conflicts between the Cache-Control and Expires headers, the Cache-Control header value takes precedence in determining the maximum age of keeping content in a cache.
Note: If you decide to honor origin headers, you must also set a Max age to use in case the relevant origin header is unreachable.

To learn more about caching at Akamai, see the Time to Live (TTL) in Cache guide and the “Caching” section in the Edge Server Configuration Guide. You can find these guides under Support in Control Center. Note that these guides focus more on websites than APIs, but the core explanations of caching behaviors apply to both environments.