0
votes

I am using amazon S3 and cloudfront to scale and serve my images. I use following situation:

  1. Images are stored on S3
  2. A webpage requests an image via cloudfront cdn with custom scale in url. If the image exists, it will be served from cloudfront cache. If there is no cached image, I have a php script that gets the image from s3 , resizes it and serves it ( it will be cached by cloudfront )

Is there a possibility to serve the scaled image directly from s3. Now I have to host the php script to scale the image on my personal hosting / generates traffic

example url: //mycloudfrontcdn.com/500/image.jpg

1

1 Answers

0
votes

Is scaling script a something you have control of? If it is the case it can upload scaled image back to S3. And right after receiving new request it might query S3 if correctly scaled image already exists.