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 天前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南