0

I am storing 6 images in S3, and getting all of them in a single request, by a call to S3 per image.

The load time of the page already increased by 1-2 seconds, and there are more images to come. I am converting images to base64 from buffer after retrieving, and am not sure if it is the right approach.

Any suggestions?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
cantoraman
  • 56
  • 3
  • Why are you converting them to Base64? What are you doing with the images? – hephalump Mar 28 '21 at 23:24
  • I am displaying them on the frontend once I retrieve them. – cantoraman Mar 29 '21 at 20:58
  • Why not just have the front end request the object directly from S3? If you want to speed it up you can put CloudFront in front of your S3 bucket and you can cache your objects at the edge close to your user. CloudFront will compress it automatically also; either gzip or brotli. – hephalump Mar 29 '21 at 21:13
  • Thank you! Will do that way. – cantoraman Mar 29 '21 at 21:24

0 Answers0