In Lambda@Edge the functions will automatically get triggered in response to any of the following CloudFront events:
- Viewer Request - Event occurs when the end user on the Internet makes an HTTP(S) request to Amazon CloudFront, and then the request arrives at the edge location which is closest to that user.
- Viewer Response - Event occurs when the Amazon CloudFront server at the edge will be ready to respond to end user or device that made request.
- Origin Request - Event occurs when the Amazon CloudFront edge server does not already contain the requested object in the cache, and the viewer request is ready to send to your backend origin webserver.
- Origin Response - Event occurs when the Amazon CloudFront server that is at the edge receives a response from the backend origin webserver present at your end.