Ensure that response caching is enabled for your Amazon API Gateway REST APIs in order to enhance API responsiveness and decrease latency.
This rule can help you with the following compliance standards:
- NIST4
For further details on compliance standards supported by Conformity, see here.
This rule can help you work with the AWS Well-Architected Framework.
This rule resolution is part of the Conformity Security & Compliance tool for AWS.
efficiency
You can reduce the number of calls made to your API endpoint and also improve the latency of requests to your API with response caching. When you enable caching for an API stage, Amazon API Gateway service caches responses from your endpoint for a specified time-to-live (TTL) period, in seconds. API Gateway responds to the request by looking up the endpoint response from the cache instead of making a new request to your API endpoint and therefore serving the API request very fast.
Note: The default time-to-live (TTL) value for API caching is 300 seconds. The maximum TTL value is 3600 seconds. TTL = 0 means caching is disabled. The maximum size of a response that can be cached is 1048576 bytes.
Audit
To determine if your API Gateway API stages have response caching enabled, perform the following operations:
Remediation / Resolution
To enable response caching for your existing Amazon API Gateway REST APIs, perform the following operations:
References
- AWS Documentation
- Amazon API Gateway FAQs
- Optimizing performance of REST APIs
- Enabling API caching to enhance responsiveness
- AWS Command Line Interface (CLI) Documentation
- apigateway
- get-rest-apis
- get-stages
- update-stage