Caching
You can use the caching feature to store an API request's response and serve it to the client. It reduces the load on the server and improves the API's performance. The default TTL is 60 seconds and cannot be changed.
You can use the cache for both the API Gateway and the Route and configure the cache settings as needed.
The full API specification is documented in the API Gateway REST API.
Gateway Request
enabled: To enable or disable the cache.
httpMethods: The HTTP methods for which the cache is enabled. Valid methods are
GET
,POST
andHEAD
.httpCodes: The HTTP status codes for which the cache is enabled. Valid codes are >= 200 and <= 599.
override: To override the cache settings for all the existing routes of this API Gateway instance.
Note: Any route created under this API Gateway instance will inherit the cache settings of the API Gateway instance.
You can use the override flag to change the cache settings for all the existing Routes of this API Gateway instance. This flag is only available on the API Gateway PUT
request.
Route Request
If you need to change the cache settings for a specific Route, you can do so by updating the Route.
Last updated
Was this helpful?