Ive have been able to figure out how to set the http header, cache-control: max_age on a single file using the AWS console. However, I would like to do it for all files in a S3 bucket.
How do I go about doing that for say 500 files in one bucket? I can't do it for each individual file using the AWS console.
If you can't do it through AWS. can you recommend a third party app?
Thanks, Jeff
This has since been improved, you can edit folder metadata in the console, just select the folder(s) or file(s), press Actions
, choose Change Metadata
and you'll be presented with a panel like this:
in https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-object-metadata.html
The only way to modify object metadata is to make copy of the object and set the metadata. In the copy operation you set the same object as the source and target.
— http://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html
This is the operation that the console is doing for you, behind the scenes. There is no batch operation provided.
You'll need to write some code to iterate through the objects in the bucket and call the api for each object you want to modify.
Or, find a tool or library that can do that for you. Which tool and where to find it are questions outside the scope of Stack Overflow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With