- Newest
- Most votes
- Most comments
Hello,
For simple operation you can try to leverage Cloudfront functions which operates at edge. You can get support from this blog which details the difference with lambda and it could help you to find a solution.
I am assuming you are talking about Origin Edge Lambdas.
You should do below:
- Setup Origin Shield on the Origin in the Cloudfront
- Mark the origin region for the origin shield as UAE Henceforth all origin lambda executions would be triggered in the UAE region. This is because Origin Shield forces all Origin Lambda calls to execute at the shield origin region
Thanks we were able to drop our API times by 200 to 250 ms by enabling origin shield and setting it to be in the same region as our Backend, Mumbai.
@rayyan happy to know it has helped you. Please upvote if you found my answer helpful. Thanks
Lambda@edge are invoked at 'Regional Edge Cache'[1], and the 'Regional Edge Cache' might not be the same location as the 'PoP'. Therefore, a possible alternative is to have your logic run in CloudFront Functions, which would be invoked in the 'PoP' where the traffic lands. ( Just like 'AWS-User-7455027' mentions)
You may also check the following article to understand more about them.
- Customizing at the edge with functions - Choosing between CloudFront Functions and Lambda@Edge - https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions.html#edge-functions-choosing
Lambda@Edge functions are executed in a regional edge cache (usually in the AWS region closest to the CloudFront edge location reached by the client)
Relevant content
- asked 2 months ago
- Accepted Answerasked 7 months ago
- asked 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Thanks, I hadn't come across anything yet that explicitly stated that Edge Lambdas are executed at regional edge caches only but had a guess that this might be the case