#GPT-4 Conversation #1104388028555866212
1 messages · Page 1 of 1 (latest)
In a GET request, is it okay for the backend to call S3 to pre-sign around 100 images' urls?
Yes, it's okay for the backend to call S3 to pre-sign URLs for multiple images in a GET request. However, keep in mind that pre-signing 100 URLs in a single request might introduce some latency, as the backend has to make multiple calls to S3 to get the pre-signed URLs. This might affect the performance and user experience, especially if you need to do this frequently or for a large number of images.
If performance is a concern, you could consider:
- Caching the pre-signed URLs on the backend or in a CDN, if the same image URLs are requested frequently.
- Reducing the number of pre-signed URLs generated in a single request, and using pagination or other mechanisms to fetch additional URLs if needed.
- Implementing a lazy-loading mechanism on the frontend so that the images are only pre-signed and loaded when the user actually needs to view them.
Regardless of the approach used, make sure you secure the S3 bucket appropriately and set an appropriate expiration time for the pre-signed URLs.
(3) is not an option.
Is ~15-images in a request a reasonable number?