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?

已提问 2 年前378 查看次数
3 回答
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
专家
Uri
已回答 2 年前
0
已接受的回答

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/

专家
已回答 2 年前
0

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

AWS
Piotrek
已回答 18 天前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则