Latency in Loading Images

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.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Upload and Attach Images
Work with Images
Developer Dashboard

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Hey @hannah! Any time you use a workaround that’s not an officially documented solution, there’s always going to be a risk that something changes in the future that causes that workaround to be invalid. Given that the image file path you’re using is not intended to be exposed externally, there’s no guarantee that the path will not change in the future.

That said, thank you for raising this issue! I’ll look into it and see if anything can be done here.

Hi @josh-square, thanks for your response. Yes, I’d really appreciate it if you could look into the latency from aws.

Related to this - is there a way to get the related objects with /v2/catalog/search-catalog-items ? Right now, I need to iterate through each item in the return to fetch the image data (from /v2/catalog/object/{object_id}) individually from the imageIds, which is also adding to the load time.