Image download and rendering takes too long
We are building an ios app and are running into problems rendering a number of images directly fetched from S3 using graphql query which fetches the public image url and then displays it on ios client side.
The current flow is as follows:
-
We are uploading images as public to S3 and then storing public url to db.
-
When users login we are simply fetching image url's and rendering in the ui.
When following the above process we are encountering slowness in rendering the images of sometimes up to 3 seconds which is not feasible for our use case. We are wondering if the storage and retrieval of images from S3 directly is not the best way as S3 is meant more for heavy duty data? Is it better to use cloudfront as a layer between S3 and our app? Or is there a better solution. It is also worth noting that when we use other public images where we just take the image url and store it directly into db its much faster than uploading to S3 and then using that image. Is there something we are missing here?
https://github.com/aws-amplify/amplify-cli/issues/1910 is the same issue