Lambda@Edge Flashcards

1
Q

What is Lambda@Edge?

A

A service that lets you run Lambda functions at AWS edge locations worldwide to customize and process content delivered by Amazon CloudFront, reducing latency.

Example: Running a Lambda@Edge function to resize images based on user device.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is Lambda@Edge triggered?

A

Triggered by CloudFront events, enabling actions both when a request is received and before a response is sent to the user.

Additional Information: Lambda@Edge is triggered by events like viewer request, origin request, origin response, and viewer response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are typical applications for Lambda@Edge?

A

Personalizing Content: Adjust content based on user location or device type.
URL Rewrites: Modify URLs on the fly to streamline SEO.
Security Headers: Insert security-related HTTP headers to enhance site security.

Example: Using Lambda@Edge to dynamically change image URLs based on user location.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What advantages does Lambda@Edge offer?

A

Enhanced Performance: Processes requests closer to the user, speeding up content delivery.
Reduced Load: Offloads tasks from the origin server, reducing backend load.

Example: Implementing Lambda@Edge to cache frequently accessed content at edge locations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What should developers keep in mind when using Lambda@Edge?

A

Statelessness: Functions must be stateless as they could run at any edge location.
Resource Limits: Functions have strict limits on runtime and memory, designed for quick execution.

Additional Information: Developers should optimize Lambda@Edge functions for quick execution to avoid timeouts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can Lambda@Edge customize content based on user country?

A

Lambda@Edge can access the CloudFront-Viewer-Country header in viewer requests to determine the user’s country. It can then dynamically modify the HTTP response to deliver localized content or redirect the user to a region-specific version of the site.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly