Customize at the edge with CloudFront Functions (original) (raw)
With CloudFront Functions, you can write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. Your functions can manipulate the requests and responses that flow through CloudFront, perform basic authentication and authorization, generate HTTP responses at the edge, and more. The CloudFront Functions runtime environment offers submillisecond startup times, scales immediately to handle millions of requests per second, and is highly secure. CloudFront Functions is a native feature of CloudFront, which means you can build, test, and deploy your code entirely within CloudFront.
When you associate a CloudFront function with a CloudFront distribution, CloudFront intercepts requests and responses at CloudFront edge locations and passes them to your function. You can invoke CloudFront Functions when the following events occur:
- When CloudFront receives a request from a viewer (viewer request)
- Before CloudFront returns the response to the viewer (viewer response)
For more information about CloudFront Functions, see the following topics:
Topics
- Tutorial: Create a simple function with CloudFront Functions
- Tutorial: Create a CloudFront function that includes key values
- Write function code
- Create functions
- Test functions
- Update functions
- Publish functions
- Associate functions with distributions
- Amazon CloudFront KeyValueStore
Differences between CloudFront Functions and Lambda@Edge
Tutorial: Create a simple CloudFront function
Did this page help you? - Yes
Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Did this page help you? - No
Thanks for letting us know this page needs work. We're sorry we let you down.
If you've got a moment, please tell us how we can make the documentation better.