amplify-ui icon indicating copy to clipboard operation
amplify-ui copied to clipboard

S3Image request to support non-signed urls (amplify-react)

Open dmoskovtsov opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. Usecase: we use S3Image to display images on the publicly available website (level: public). We also use prerendering service (prerender.io) to cache webpages to improve SEO. When prerender crawls our website, img src contains signed url that expires. It doesn't work in our case, as the img src url expires faster than our cache updates (every 3 days).

Describe the solution you'd like Have an ability to use plain url and not signed one for public images. e.g Signed url: https://bucket.amazonaws.com/public/product-5412783053848.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential==........

Plain url: https://bucket.amazonaws.com/public/product-5412783053848.jpg

Describe alternatives you've considered We built our own image component where we strip the signed portion URL off. But hoping to use standard S3Image going forward. Happy to provide/implement code assuming there is an agreement on API.

Cheers

dmoskovtsov avatar Dec 15 '20 14:12 dmoskovtsov

@dmoskovtsov

Just curious, why do you need the image to be loaded on the SEO?

elorzafe avatar Dec 15 '20 18:12 elorzafe

@elorzafe there are a few reasons to that, but the main is that images are returned for 19% of search queries on Google. And we believe helping search engines to understand what present at your images affects the ranking (as we believe that Google uses image recognition and not only reading "alt").

dmoskovtsov avatar Dec 21 '20 10:12 dmoskovtsov

It sounds like <img> would fit your needs better, since the image isn't from a signed S3 bucket.

Is there a benefit to <S3Image> over <img>?

https://docs.amplify.aws/ui/storage/s3-image/q/framework/react#props-attr-amplify-s3-image

ericclemmons avatar Feb 23 '21 22:02 ericclemmons

@ericclemmons The benefits would be using the same mechanism for managing image keys/environments (S3 buckets) for images with public and protected scopes.

Otherwise, you'd need to save full images URLs for publicly available images at your bucket and imgKeys for protected images. Or building your own SEO-friendly S3Image component as we did.

dmoskovtsov avatar Mar 04 '21 02:03 dmoskovtsov

Closing out issue as the S3Image component has been deprecated.

reesscot avatar Dec 12 '22 23:12 reesscot