serverless-image-handler
serverless-image-handler copied to clipboard
Use Origin Shield Failover to improve cost efficiency and allow bigger images to be processed
Is your feature request related to a problem? Please describe.
- If there is a miss on Cloudfront, Lambda will always be called to generate an image.
- Lambda limits the size of images that can be processed (returned to the client)
Describe the feature you'd like
There is another 'image optimization' project from AWS which describes a way to use Sharp to resize images. It's a lot less sophisticated on the transformations, but it does use a failover mechanism provided by Origin Shield which allows the 'transformed' image to be persisted to another S3 bucket (which solves 1).
It would also provide a mechanism for supporting larger images by persisting the image and returning a status code that tells te client to restart the request. At the time the client restarts the request the image will be available in S3 and can be served.
https://github.com/aws-samples/image-optimization.
From my perspective it would also make sense to combine these two repositories / solutions because of their similarities.
Additional context
https://github.com/aws-samples/image-optimization/compare/main...graceful-failover
Thanks for the suggestion. We've added this to our backlog and will evaluate adding it to a future release.