exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 182 discussion

A company developed an API application on AWS by using Amazon CloudFront, Amazon API Gateway, and AWS Lambda. The API has a minimum of four requests every second. A developer notices that many API users run the same query by using the POST method. The developer wants to cache the POST request to optimize the API resources.

Which solution will meet these requirements?

  • A. Configure the CloudFront cache. Update the application to return cached content based upon the default request headers.
  • B. Override the cache method in the selected stage of API Gateway. Select the POST method.
  • C. Save the latest request response in Lambda /tmp directory. Update the Lambda function to check the /tmp directory.
  • D. Save the latest request in AWS Systems Manager Parameter Store. Modify the Lambda function to take the latest request response from Parameter Store.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
kr5031
Highly Voted 1 year, 6 months ago
Selected Answer: B
A is incorrect, because of CloudFront always caches responses to GET and HEAD requests. You can also configure CloudFront to cache responses to OPTIONS requests. CloudFront does not cache responses to requests that use the other methods. (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html)
upvoted 7 times
dilleman
1 year, 6 months ago
I agree, I think B is correct as well looking into it more.
upvoted 2 times
...
...
Jing2023
Highly Voted 1 year, 6 months ago
Selected Answer: B
Why A is not correct Amazon CloudFront does not cache the responses to POST, PUT, DELETE, and PATCH requests – these requests are proxied back to the origin server. You may enable caching for the responses to OPTIONS requests.
upvoted 5 times
...
Anandesh
Most Recent 9 months ago
Selected Answer: B
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html#override-api-gateway-stage-cache-for-method-cache
upvoted 1 times
...
65703c1
11 months, 2 weeks ago
Selected Answer: B
B is the correct answer.
upvoted 1 times
...
KarBiswa
1 year, 2 months ago
Selected Answer: B
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html#:~:text=When%20you%20enable,caching%20is%20disabled.
upvoted 2 times
...
SerialiDr
1 year, 3 months ago
Selected Answer: B
API Gateway allows caching of responses, and you can enable caching for specific methods, including POST. This option is a viable solution as it leverages the built-in capabilities of API Gateway to cache responses. By configuring caching at the API Gateway stage level, the developer can cache responses to POST requests based on defined parameters.
upvoted 5 times
...
dilleman
1 year, 6 months ago
Selected Answer: A
A is the correct answer here. CloudFront can be configured to cache based on request headers, query strings, and POST request bodies. Option B might work but it does not work by default and it's not an effective way to solve this.
upvoted 1 times
...
Digo30sp
1 year, 6 months ago
Selected Answer: B
The correct answer is (B). Solution (B) is the best option because it uses the Amazon API Gateway cache to cache POST requests.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago