Skip to main content

AWS CDN

AWS CloudFront

CloudFront functions vs Lambda@Edge

FeatureCloudFront FunctionsLambda@Edge
Programming languagesJavaScript (ECMAScript 5.1 compliant)Node.js and Python
Event sourcesViewer request, Viewer responseViewer request, Viewer response, Origin request, Origin response
Scale10,000,000 requests per second or moreUp to 10,000 requests per second per Region
Function durationSubmillisecondUp to 5 seconds (viewer request and viewer response), Up to 30 seconds (origin request and origin response)
Maximum memory2 MB128 – 3,008 MB
Maximum size of the function code and included libraries10 KB1 MB (viewer request and viewer response), 50 MB (origin request and origin response)
Network accessNoYes
File system accessNoYes
Access to the request bodyNoYes
Access to geolocation and device dataYesNo (viewer request), Yes (origin request, origin response, and viewer response)
Can build and test entirely within CloudFrontYesNo
Function logging and metricsYesYes
PricingFree tier available; charged per requestNo free tier; charged per request and function duration

来源