The urls returned with image objects have a TON of latency. Theyre hosted on https://items-images-production.s3.us-west-2.amazonaws.com/
I discovered that the same images displayed in the Seller Dashboard are from https://items-images-production-f.squarecdn.com/
These images load without noticeable latency. I also noticed that the bytes transferred are lower, but the original file size is ~70kb and shouldn’t cause issues with loading anyway.
It looks like the file path to the images are the same, so I am swapping out the aws host with the square cdn host in my backend before I return the image urls to my clients.
Example:
Url returned from the api: https://items-images-production.s3.us-west-2.amazonaws.com/files/fd1dde41b75474fa0edd9cab5df83148b7c8bbd1/original.jpeg
(446 ms load time)
Url with the domain swap: https://items-images-production-f.squarecdn.com/files/fd1dde41b75474fa0edd9cab5df83148b7c8bbd1/original.jpeg
(154 ms load time)
Question:
Is this going to cause problems down the line? Is there a right way to do this?
The images fetched from the aws host are unusable; I can’t justify adding that much latency to my apps for <70kb files.
4 posts - 3 participants