In AWS, we can use Lambda@Edge utility to solve the problem of low
network latency for end users.
In Lambda@Edge there is no need to provision or manage servers. We can just
upload our Node.js code to AWS Lambda and create functions that will be
triggered on CloudFront requests.
When a request for content is received by CloudFront edge location, the
Lambda code is ready to execute.
This is a very good option for scaling up the operations in CloudFront without
managing servers.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html