Home > Software design >  How can I remove Cache-Control metadata in S3 using the CLI?
How can I remove Cache-Control metadata in S3 using the CLI?

Time:03-16

In AWS S3, using the CLI, I know how to set Cache-Control headers, like this:

aws s3 cp s3://mybucket/ s3://mybucket --cache-control 'whatever' --recursive

How do I remove the Cache-Control? I want to remove this metadata for every object in a bucket.

CodePudding user response:

The only supported way is to replace all of the metadata:

aws s3 cp s3://mybucket/ s3://mybucket/ --metadata-directive REPLACE --recursive

Note that this will replace all of the metadata for the objects, so if you have any other items you wish to maintain, you'll need to recreate them.

  • Related