Events that can trigger Lambda@Edge:
- After CloudFront receives a request from a viewer (viewer request)
- Before CloudFront forwards the request to the origin (origin request)
- After CloudFront receives the response from the origin (origin response)
- Before CloudFront forwards the response to the viewer (viewer response)
With Lambda@Edge you can:
- Inspect cookies and rewrite URLs to perform A/B testing.
- Send specific objects to your users based on the User-Agent header.
- Implement access control by looking for specific headers before passing requests to the origin.
- Add, drop, or modify headers to direct users to different cached objects.
- Generate new HTTP responses.
- Cleanly support legacy URLs.
- Modify or condense headers or URLs to improve cache utilisation.
- Make HTTP requests to other Internet resources and use the results to customise responses
Here are just a few Lambda@Edge use cases:Highly Personalised Websites URL Rewrites Remote Network Calls Response Generation At Viewer Request Access Control at the Edge A/B Testing To start using Lambda@Edge you need to associate a function with the CloudFront distribution. The function will be automatically replicated and ready to run at every AWS Edge location.
Creating Lambda functions that integrate with CloudFront:To view Lambda@Edge limitations, read the this AWS blog post. If you'd like to learn more about moving your business to the Cloud, please contact us here.
Get in Touch.
Let’s discuss how we can help with your cloud journey. Our experts are standing by to talk about your migration, modernisation, development and skills challenges.