ExitAmazon CloudFront: edge request processing1 / 9
Explanation

Separate viewer work from origin work

How CloudFront Functions and Lambda@Edge execution points, constraints, and cache interactions shape low-latency request processing and dynamic origin selection. · advanced

Execution placement determines which requests pay for edge processing. A viewer-request handler runs before CloudFront checks its cache. A Lambda@Edge origin-request handler runs when CloudFront must forward a request to an origin, not when a cached response satisfies it.

The diagram shows one request-side implementation: a CloudFront Function performs lightweight request normalization, and Lambda@Edge makes a network-dependent origin decision only on the origin-bound path. The two origin arrows are alternatives, not a broadcast. Response processing is omitted from this request-path diagram.

Viewer requestCache missIf route AIf route B
UsersViewer
Amazon CloudFrontViewer-request CloudFront Function, then cache lookup
AWS LambdaLambda@Edge origin-request handler: network-dependent origin selection
Amazon S3 bucketOrigin A
Amazon S3 bucketOrigin B

1 / 5 The viewer sends a request for content.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.