Skip to content
Static Website: Image optimization for https://templates.cloudonaut.io/en/stable/static-website/
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lambda-src
.gitignore
README.md
lambdaedge-img-optimize.yaml

README.md

Static Website: Image optimization

Works together with https://templates.cloudonaut.io/en/stable/static-website/

Optimizes .png, .jpg, and .jpeg images and enerates .webp images at the edge.

Installation Guide

Requires Node.js v10!

cd lambda-src
docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs10.x npm ci --production
cd ..
aws --region us-east-1 cloudformation package --s3-bucket $BUCKET_NAME --template-file lambdaedge-img-optimize.yaml --output-template-file .lambdaedge-img-optimize.yaml
aws --region us-east-1 cloudformation deploy --template-file .lambdaedge-img-optimize.yaml --stack-name lambdaedge-img-optimize --capabilities CAPABILITY_IAM

Copy the OriginRequestLambdaEdgeFunctionVersionARN output of the stack and use it with static-website/static-website.

You can’t perform that action at this time.