Ends in
00
days
00
hrs
00
mins
00
secs
SHOP NOW

Practice Test + eBook Bundle Sale - Buy our Practice Test and get the supplementary eBook at 50% OFF

Find answers, ask questions, and connect with our
community around the world.

Home Forums AWS AWS Certified Developer Associate Question about getting updated data from API GW with LEAST effort

  • Question about getting updated data from API GW with LEAST effort

  • Arghya Chakraborty

    Member
    March 29, 2022 at 10:45 am

    This was the question:

    An update was made on an AWS Lambda-based application. It is invoked by an API Gateway endpoint with caching enabled to improve latency requests. The developer expected to get the latest data as a response when he tested the application. However, he kept getting stale data upon trying many times.

    What should the developer do that will require the “LEAST amount of effort” to resolve the issue? (Select TWO.)

    A) Set the new endpoint as a trigger for the lambda function.

    B) Grant permission to the client to invalidate caching when there’s a request using the IAM execution role.

    C) Include Cache-Control: max-age=0 HTTP header on the API request.

    D) Create a new REST API endpoint and disable caching.

    E) Include Cache-Control: no-cache HTTP header on the API request.

    Now, obviously B & C are the correct choices. And that’s what I was going to select.

    But then I saw the “LEAST amount of effort” thing & my decision got swayed and I ended up choosing: A & D – thinking it is probably easier to do so since it will not involve any change at the invocation end. Note: one person’s least amount of effort may be another person’s dread.

    But if the words would have been “What should the developer IDEALLY do to resolve the issue? (Select TWO.)” – the answer would have been straight-forward – because the ideal solution is provided by AWS & there is no second opinion about it.

    I do not know why these kind of confusing words are introduced in many questions throughout the course – IDK how are students going to benefit from it ? We should teach the students what is the right approach than to trick them using fancy words & confuse them.

    The AWS certification exams are not English language tests – let me remind you – they are test of technical acumen.

    I used to like TD exams. Now I am not too sure about the quality of them.

  • Tutorials-Dojo

    Administrator
    March 29, 2022 at 1:36 pm

    Hi Arghya,

    Thank you for posting your inquiry. First of all, were you able to read the provided explanation in the first place, including the AWS reference that comes along with it? It’s pretty clear that you haven’t.

    I don’t quite agree with your point that the given answers are incorrect simply because of the phrase “LEAST amount of effort”. Option C is wrong because this option is suggesting to force reload the API Cache via the no-cache setting, which will contradict the requirement of improving the latency requests. It’s incorrect not because of the English language semantics in the scenario, but due to its technical inaccuracy. The no-cache and max-age=0 settings are almost similar, but they do have some key differences.

    Based on our explanation, the 2 correct answers are options B and E as shown below:

    • OPTION B: Include Cache-Control: max-age=0 HTTP header on the API request.
    • OPTION E: Grant permission to the client to invalidate caching when there’s a request using the IAM execution role.

    Those two options are the correct answer based on the official AWS documentation that we included in our references. Pasting the link again for everybody’s reference:

    https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html#invalidate-method-caching

    You said:

    But if the words would have been “What should the developer IDEALLY do to resolve the issue? (Select TWO.)” – the answer would have been straight-forward – because the ideal solution is provided by AWS & there is no second opinion about it.

    Again, the answers that we have provided are actually based on the above documentation that is provided by AWS team itself. There is no second opinion about it.

    On the contrary, you have NOT even shared a single piece of documentation that using Cache-Control: max-age=0 is recommended to invalidate the API Cache in API Gateway. Please be reminded that the Cache-Control values could have a different value in different systems.


    OPTION C is shown as follows:

    Include Cache-Control: no-cache HTTP header on the API request.


    Setting the Cache-Control is not a good option in this case. Moreover, the scenario explicitly mentioned that it is using API Caching to improve/reduce the latency of the requests.


    Take note, that the Cache-Control: no-cache option will require the caches to revalidate each request with the origin server. This will configure the caches to always check for content updates while reusing stored content. This will effectively cause increased latency to your requests since it will hit the origin and fetch the results directly from the database/data source each and every time.


    So what’s our rationale as to why we tagged this option as incorrect? In our provided explanation, we mentioned that:

    The option that says: Include Cache-Control: no-cache HTTP header on the API request is incorrect. Although “no-cache” is a valid value for the Cache-Control HTTP header, it is not the right value when invalidating API Gateway cache. The Cache-Control: max-age=0 header must be used.

    The idea here is to invalidate the stale data in the API Gateway cache. The correct answers are already mentioned in the official AWS documentation. This document should be our source of truth:

    https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html#invalidate-method-caching

    I do know AWS Certifications are not English Proficiency tests, like IELTS. That’s why our provided answers are based on what is mentioned in the official AWS documentation, and not on our own unsubstantiated opinion.

    Let us know if you need further assistance. The Tutorials Dojo team is dedicated to help you pass your AWS exam on your first try!

    Regards,

    Jon Bonso @ Tutorials Dojo

  • Abhishek Singh

    Member
    March 29, 2022 at 3:04 pm

    Arghya,

    Using no-cache is wrong. That’s an obsolete way of invalidating the cache:

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

    AWS docs said to use max-age:0 and not the no-cache value.

Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now