AWS Lambda@Edge
- Deploy AWS Lambda globally at edge location
- Can use Lambda to change CloudFront request and response
- viewer request: after cloudfront receives request from viewer
- origin request: before cloudfront forward request to origin
- origin response: after cloudfront receives response from origin
- viewer response: beore cloudfront forwards response to viewer
We can also generate responses to viewer without going through origin by using viewer request and viewer response.