Dynamic images through cloudfront
I am considering moving some of my applications to Laravel Vapor, but I have a question about serving images.
Currently, I have a CDN that I can send a UUID and optionally some sizing parameters. This CDN will fetch the location of the asset from the database, resize or modify the image if needed, cache the result, and return the resulting image response.
The Vapor documentation says that Vapor will deploy static content through CloudFront, but would it also be possible to serve my CDN content through CloudFront? New images are added to the CDN every day, so it would not be possible to deploy for every update.
Basically what I would like is the very first request for an image with a certain size to be routed to lambda, it creates the image and stores it on S3 and every next request with the same parameters should come from this cached image.
Could someone give me an example of how this could be implemented on Vapor, if it is possible?
Thanks in advance :)
Please or to participate in this conversation.