Cloudfront with Image Optimization

Cloudfront with Image Optimization

December 11, 2022

This blog is built with Hugo, and served by GitHub Pages.

All static images are uploaded to AWS S3, and served by another domain, https://dgvi9bqir6m5j.cloudfront.net. This CDN domain maps to AWS Cloudfront:

  1. Client -> https://dgvi9bqir6m5j.cloudfront.net/xxx?format=webp
  2. Cloudfront triggers AWS Lambda Function to convert original images to specified format
  3. Transformed images are stored in another S3 Bucket imgtransformationstack-s3transformedimagebucket6d-fjwwbg2y69cf

For more information, please check AWS CDK Sample and AWS CloudFormation.