如何给在Amazon S3里的对象添加缓存控制

0

【以下的问题经过翻译处理】 我们怎么才能给Amazon S3里的对象添加缓存控制呢?

profile picture
EXPERT
asked 5 months ago49 views
1 Answer
0

【以下的回答经过翻译处理】 您可以使用下面的命令来给Amazon S3里的对象添加缓存控制:

aws s3 cp s3://<yourbucket>/ s3://<yourbucket>/ --recursive --metadata-directive REPLACE \
--expires 2022-01-01T00:00:00Z --acl <your-acl> --cache-control max-age=2592000,public

根据需要替换命令行里的占位符部份即可

当您创建新的S3对象时,需要确保设置了元数据。 更多的信息可以参考 https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions