简体   繁体   中英

How to generate a public amazon-s3 link to a file with infinite TTL?

According to this piece of official doc, if I generate a presigned link it will expire sooner or later and I want to have unchangeable links that I could store in a DB. The reason for doing so is that it would make those links cacheable thereby avoiding loading them over and over again.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html

If the avatar/photo objects are publicly readable, then you don't need to create pre-signed URLs. Simply share each public URL, which is of the form:

https://mybucket.s3.amazonaws.com/myavatars/shark.png

More generally, see here .

If the objects are private, then the standard way to make them available to non-AWS users is to share pre-signed URLs. For more on the duration of pre-signed URLs, see here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM