An API implemented with CloudFront, API Gateway, and Lambda receives at least four requests per second. Many users run the same query via POST. The developer wants to cache POST responses to reduce load. What should they do?
Choose an answer
Tap an option to check your answer.
Correct answer: Override the cache behavior in the chosen API Gateway stage and enable caching for the POST method..
Why this is the answer
The correct approach is to override the cache behavior in the API Gateway stage and enable caching for POST methods. API Gateway's caching mechanism is designed to handle caching for various HTTP methods, including POST, and can significantly reduce the load on backend Lambda functions by serving cached responses directly. Configuring CloudFront caching alone isn't sufficient because CloudFront typically caches GET requests by default and requires specific configuration to cache POST requests, which might still involve API Gateway processing the request initially. Storing responses in the Lambda /tmp directory is not a scalable or persistent caching solution; /tmp is ephemeral and limited in size, making it unsuitable for caching across multiple invocations or users. Storing responses in AWS Systems Manager Parameter Store is also not ideal for high-volume caching; Parameter Store is designed for configuration data and secrets, not for high-throughput, low-latency caching of API responses.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed