Alexander  Capone
Alexander Capone

Reputation: 548

Amazon S3 images for web site[Advice needed]

My hosting has very limited memory space, and I want part of my images(or all of them) be saved at amazon S3 service.

For example, User uploads a picture at site. I take original image, create 5 different thumbnails with it, send original image to S3 with putObject function, and delete it locally. Then user wants to edit his picture, lets say rotate it. I will download original image, rotate it, re-generate 5 thumbnails from it, and put again to S3?

What if i want one of my generated images thumbnails be at Amazon S3, this image is rarely viewed(lets say it is a big portrait, and served only on click at user profile). Do i download image to machine, send it to page, and delete it? Will this approach be fast? Is there better logic for this part?

Struggle for advices.

Upvotes: 0

Views: 143

Answers (1)

E.J. Brennan
E.J. Brennan

Reputation: 46839

There is no reason you can't store all your images on S3 - the original and all of the generated thumbnails.

The host receives the uploaded images, generates the required thumbnails and the PUTs them all to S3. Your web application then references all of your images directly from the S3 location - there is no need to download them to your host in order to show them on your website.

Serving your images (and in fact all of your static content - i.e. css files and js files) from S3 will in all likelihood speed up the the page load of your website and if you need a further performance boost, with just a few clicks of the mouse you can use AWS Cloudfront to push your s3 files to geographically dispersed edge locations around the globe to get those items 'closer' to your intended users.

Upvotes: 1

Related Questions