2

I am working on e-commerce website where users can upload images for the product that they want to sell on the website. The website is running on a windows/IIS server.

At the moment I am using Windows file system to store the images, but sine the size of images is growing, I have decided to move them to AWS S3 bucket. My only concern is that I am not sure how good the performance would be? Is there anyway I could improve the image load time from S3? Does AWS provide a faster alternative?

1 Answer 1

2

S3 is fast enough for most use-cases. Even Amazon serves images from S3.

Having said that... Consider putting CloudFront CDN in front of the bucket and serve the images through CloudFront.

  1. It will cache them and reduce traffic from S3.

  2. It will bring the images closer to your visitors in different regions because CloudFront has Points of presence in over 160 datacentres around the world.

  3. It communicates with S3 over the internal AWS network which is often faster than public internet.

So yes, CloudFront is the answer. Hope that helps :)

3
  • 1
    It may also be possible to use CloudFlare free tier, which is cheaper than CloudFront. There are upsides and downsides to each CDN. In both cases the caching headers need to be set and checked to ensure things are cached properly, to keep the hit ratios up. Also, if static resources change, give them a new name / version number rather than having to clear caches.
    – Tim
    Aug 29, 2019 at 7:35
  • @Tim, thanks a lot. That is a very good point. So I need to set the versioning in the S3 bucket so if I update an image (when image name does not change) the cache would be cleared because of the new version. Did I understand it right? Aug 29, 2019 at 8:31
  • 1
    No. If you do that you then need to invalidate (clear) the global cache, or at least part of it, but in practice you'd probably just clear the whole cache. That increases costs and temporarily increases latency. If you make a new version of image1.jpg give it a different name, like image1_v2.jpg, then the next version image_v3.jpg, etc. That avoid cache invalidation. Don't use bucket versioning for anything other than backup.
    – Tim
    Aug 29, 2019 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .