Are resized images served with cloudfront and resized with Lambda edge cached?

0

I've just finished reading this AWS tutorial about using cloudfront with Lambda Edge to serve resized versions of an image stored in S3.

Its not entirely clear to me whether these resized images are cached or not. For instance, if person A near edge location X requests resized image https://static.mydomain.com/images/image.jpg?d=100×100 will this resized image then be cached so that it won't have to be resized again when another person requests the same resized image?

asked 2 years ago373 views
3 Answers
1

If you trigger you Lambda@Edge function from an OriginRequest or OriginResponse, the result can be cached, but it will only be cached in the nearest Regional Edge Cache. This means that other locations that connect to the same REC will get the cached values, but location which connect to a different REC, will need to resize the image again.

profile pictureAWS
EXPERT
Uri
answered 2 years ago
0
Accepted Answer

It depends on what trigger you use - you can choose to execute the Lambda on every request or only on cache misses. e.g. from https://aws.amazon.com/blogs/networking-and-content-delivery/lambdaedge-design-best-practices/ :

From https://aws.amazon.com/blogs/networking-and-content-delivery/lambdaedge-design-best-practices/

EXPERT
answered 2 years ago
0

Please see this AWS solution for Image Optimization: https://github.com/aws-samples/image-optimization

AWS
Piotrek
answered 8 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions