AWS DevOps Engineer Professional Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the AWS DevOps Engineer Professional Test. Enhance your skills with flashcards and multiple-choice questions, each offering hints and explanations. Become exam-ready!

Practice this question and more.


At which points during a request/response cycle can Lambda@Edge be used to modify data contents?

  1. Before the request is received and before the response is sent

  2. After request from viewer, before forwarding to origin, after origin response, before sending to viewer

  3. Only during viewer request and viewer response

  4. Before forwarding to origin and only after receiving origin response

The correct answer is: After request from viewer, before forwarding to origin, after origin response, before sending to viewer

The answer is that Lambda@Edge can be used to modify data contents at several key points during the request/response cycle, specifically after the request from the viewer and before forwarding it to the origin, as well as after receiving the response from the origin and before sending it back to the viewer. This flexibility allows developers to implement custom logic at different stages of the process. For instance, you might want to make changes to the HTTP headers or URL parameters based on specific request attributes right after the viewer sends the request, but before it reaches the origin server. This allows for optimizations or security checks to be performed early on. Then, the Lambda function can also process the response from the origin before it is sent back to the viewer. This could involve modifying response headers, injecting caching behavior, or even altering the content of the response itself to fit specific application needs. In contrast, the other options do not capture the full range of capabilities offered by Lambda@Edge. Limiting it to just viewer request and response overlooks the key points of interaction that allow for meaningful transformation of both incoming requests and outgoing responses. Thus, the comprehensive functionality of Lambda@Edge at multiple stages of the request/response cycle is effectively highlighted by the chosen option.