How to set expires headers to all images in a bucket in Amazon S3

后端 未结 6 1095
予麋鹿
予麋鹿 2020-12-23 11:59

We have around 10,000+ images in a bucket in Amazon S3, how can I set the expires header on all of the images in one go?

6条回答
  •  庸人自扰
    2020-12-23 12:27

    Pretty sure it's not possible to do this in a single request. Instead you'll have to make 10,000 PUT requests, one for each key, with the new headers/metadata you want along with the x-amz-copy-source header pointing to the same key (so that you don't need to re-upload the object). The link I provided goes into more detail on the PUT-copy operation, but it's pretty much the way to change object metadata on s3.

提交回复
热议问题