【发布时间】:2017-07-21 21:13:06
【问题描述】:
假设我已使用以下命令将一个对象复制到 Google Cloud Storage 存储桶中:
gsutil -h "Cache-Control:public,max-age=3600" cp -a public-read a.html gs://some-bucket/
我现在想“在云端”复制此文件,同时保留公共 ACL 并同时更新 Cache-Control 标头:
gsutil -h "Cache-Control:no-store" cp -p gs://some-bucket/a.html gs://some-bucket/b.html
这个操作是原子的吗? IE。我可以确定,gs://some-bucket/b.html 对象最初将通过修改后的Cache-Control:no-store 标头可用吗?
我提出问题的原因是:我使用 Google Cloud Storage 存储桶作为 CDN 后端。虽然我希望 CDN 根据 Cache-Control 标头中提供的 max-age 缓存存储桶中的大多数对象,但我想确保一些特定文件(实际上是可缓存版本的副本)是从不由 CDN 缓存。因此,至关重要的是,这些对象在被复制时永远不会出现Cache-Control:public,max-age=XXX,而是立即出现Cache-Control:no-store 标头,以消除来自 CDN 的请求在某个时间点读取复制对象的可能性max-age 仍然存在,因此缓存了应该永远不会被缓存的对象。
【问题讨论】:
标签: google-cloud-storage gsutil