Google Cloud Storage 开发人员指南解释了如何设置 Cache-Control 标头,并解释了它们对 api 一致性行为的关键影响,但没有提及 Expires 标头,它们似乎也没有从 Cache-Control 配置继承。
无论 Cache-Control 设置如何,Expires 标头似乎总是等于请求时间加上 1 年,例如。
$ gsutil setmeta -h "Cache-Control:300" gs://example-bucket/doc.html
通过以下方式向 Google Cloud Storage 存储桶(example-bucket)中的文档(doc.html)发出请求
$ curl -I http://example-bucket.storage.googleapis.com/doc.html
这产生了以下标题
HTTP/1.1 200 OK
Server: HTTP Upload Server Built on Oct 3 2012 16:52:30 (1349308350)
Date: Sat, 13 Oct 2012 00:51:13 GMT
Cache-Control: 300, no-transform
Expires: Sun, 13 Oct 2013 00:51:13 GMT
Last-Modified: Fri, 12 Oct 2012 20:08:41 GMT
ETag: "28fafe4213ae34c7d3ebf9ac5a6aade8"
x-goog-sequence-number: 82
x-goog-generation: 1347601001449082
x-goog-metageneration: 1
Content-Type: text/html
Accept-Ranges: bytes
Content-Length: 7069
Vary: Origin