View a markdown version of this page

Request processing workflow - Dynamic Image Transformation for Amazon CloudFront

Request processing workflow

Request resolution

  1. Incoming requests are analyzed to determine origin mapping

  2. Host-header mappings take precedence over path-based mappings

  3. Request resolver identifies the appropriate origin and transformation policy

  4. Headers and authentication parameters are prepared for origin requests

Transformation resolution

  1. Policy resolver retrieves transformation policies from in-memory cache

  2. Conditional logic evaluates client hints and request headers

  3. Explicit query parameters override policy-defined transformations

  4. Final transformation parameters are validated and normalized

Image processing

  1. Original image is fetched from the resolved origin (S3 or external)

  2. Sharp library applies transformations in the specified order

  3. Output format and quality are optimized based on client capabilities

  4. Processed image is returned through the ALB to CloudFront