skip to Main Content

I have an app which currently using S3 to store images, and it took a lot of time to load images in my mobile app.

Now I’m looking for a better way to optimize the loading time. One possible solution I came up with is to load images through a CDN (Cloudinary, Cloudfront, …). However I’m currently storing images with S3 urls in my database. How can I migrate it to use a CDN url, not the S3 one? Is there any better way than updating all the image url in my database?

2

Answers


  1. You are on the right track using S3 + Cloudfront, I think you should look up to this blogpost https://aws.amazon.com/blogs/networking-and-content-delivery/amazon-s3-amazon-cloudfront-a-match-made-in-the-cloud/

    Infrastructure example

    usually what I do is store in my database only the path, then the web application can compose the url on its own. Or else you can inject the cloudfront url for each image directly from your backend.

    The blogpost also has a CloudFormation stack you can use to deploy everything as code.

    Login or Signup to reply.
  2. If you’re interested in using Cloudinary, you can still use your own S3 and just use Cloudinary for optimization and delivery. Cloudinary is a multi-CDN network and will handle spikes in traffic, caching and delivery on a global scale. There can be a lot of headaches you can just avoid.

    https://support.cloudinary.com/hc/en-us/articles/202520492-Can-images-be-stored-in-my-own-S3-bucket-

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search