Take serverless to your users

Customize your content delivery while reducing load on your origin

AWS Cloud
Try Lambda@Edge

With Lambda@Edge you can easily run your code across AWS locations globally, allowing you to respond to your end users at the lowest latency. You can choose to have your code triggered by different Amazon CloudFront events, such as requests for content to or from origin servers and viewers. After you upload your Node.js code to AWS Lambda, Lambda takes care of everything required to replicate, route, and scale your code with high availability, at an AWS location close to your end user. You pay only for the compute time you use. There is no charge when your code is not running.

Lambda@Edge Video
AWS re:Invent: Lambda@Edge Overview
Lambda@Edge Deep Dive


Lambda@Edge runs your code at an AWS location close to your end user, making it easier to deliver richer, more personalized content to your end users with lower latency.

Continuous Scaling

Lambda@Edge automatically scales your application by running code in response to each trigger by Amazon CloudFront events. Your code runs in parallel and processes each trigger individually, scaling precisely with the size of the workload.

Reduce Origin Load

Lambda@Edge automatically runs your code without requiring you to provision or manage servers across different locations. Just write your Node.js code, upload it to AWS Lambda, and your code will run at an AWS location close to your end user.

Subsecond Metering

With Lambda@Edge, you are charged for every 50ms your code executes and the number of times your code is triggered. You don't pay anything when your code isn't running.

Highly Personalized Websites

Lambda@Edge lets you add unique content delivery functionality to your websites including news, weather, and sports sites. You can deliver unique content based on both where your end user is located and the type of device they are using to access your site. Custom Device Detection/Grouping lets you send back different objects to end users accessing your website based on the user-agent field.

Response Generation at Viewer Request

You can generate an HTTP response to an end user request that arrives from any AWS locations across the globe. For example, you can redirect unauthenticated users to a login page, created on-demand. You can also generate customized error pages or static webpages directly from an AWS location that is close to your end user.

URL Rewrites

You can rewrite the URL that end users see so that it matches the origin directory structure before your forward content. This helps you build seamless experiences for end users without exposing your team structure or showing how your manage content on your website.

Access Control at the Edge

Developers can write a Lambda function that uses HTTP cookies as a way to control access to content after a user has authenticated for the first time. This lets you authenticate future content requests at a location closer to your viewer.

Remote Network Calls

By using Lambda@Edge, you can make calls to other internet services to access additional resources that you can use to tailor content or make decisions about your viewer- and origin- facing events.

A/B Testing

Lambda@Edge allows you to test different versions of your homepage (for example, an e-commerce site) with your end users, without the need for redirects or changes to your website URL.

Content-Based Dynamic Origin Selection

You can dynamically route content requests to different origin servers based on request attributes such as viewer location, viewer device type, HTTP headers, URL path, query string or cookies. For example, if you have a geographically distributed, multiple-origin setup, your Lambda functions can inspect the request attributes, such as cookies and headers to route your viewers to the most optimal origin, based on proximity to the viewer, where your data is located, user session information, and even A/B testing.

Sign up for an AWS account

Sign up for an AWS account


                          Learn with our documentation                                                

Try Lambda@Edge
Start Building with AWS

Start building with AWS