Amazon S3 Cache-Control for all bucket

前端 未结 1 489
野趣味
野趣味 2020-12-19 22:52

I use Amazon S3 and CloudFront. I have static images and users downloaded images(every hour + 100 images).

I need to set Cache-Control http header f

相关标签:
1条回答
  • 2020-12-19 23:26

    S3 does not have a mechanism for setting global bucket metadata on existing or future objects. Your code needs to set this when the objects are created.

    You can add it to existing objects using the "put/copy" operation of the API, which allows you to copy an object onto itself, with modified metadata, without actually downloading and re-uploading the object.

    http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html

    Regarding open-source solutions, there might be, but the only possible mechanism they could use would be to perform the same actions -- iterating through the bucket and updating each object's metadata via the API. In any event, though:

    Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.

    — https://stackoverflow.com/help/on-topic

    0 讨论(0)
提交回复
热议问题