简体   繁体   中英

AWS S3 and Cloudfront for storage of images

I'm using AWS S3 for storage my images and accessing them by Cloudfront. Here is mine access url formate. For example:

http://mybucket.s3.amazonaws.com/qGdyRHeptWqR5sl.jpg

I want to use thumbnail for this image. Generating thumbnails at upload time is not modern approach especially when you are required a lot of different size images. It's not good in maintenance point of view. A little change in design required to regenerate all of thumbnails again.

Is there any possibility for thumbnail image to be generated on the fly by just requesting a URL something like below:

http://mybucket.s3.amazonaws.com/thumb/200/150/qGdyRHeptWqR5sl.jpg

OR

http://mybucket.s3.amazonaws.com/qGdyRHeptWqR5sl.jpg?size=200x200

OR

http://mybucket.s3.amazonaws.com/qGdyRHeptWqR5sl.jpg?width=200&height=200

I've tried all the above url but no success. DO i need to use some image resizing plugin to do so? Do i need to request image from cloudefront & resize it then reupload it on S3?

I'm using Java as programming language please recommend me some plugin or better approach in this case.

One of possible solutions related to ngx_http_image_filter_module plugin for Nginx. You can install Nginx and configure it to resize images from S3 by request.

Here is article which describe how to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM