Google 云存储返回旧数据
Google cloud storage returning older data
这怎么可能?对于同一个文件,Date/Expires/Last-Modified headers 差异如此之大。即使此文件今天(4 月 8 日)被修改,它随机 return 4 月 7 日和之后的 4 月 3 日或 4 日!
curl -I http://storage.googleapis.com/myappname.appspot.com/config/config.json
HTTP/1.1 200 OK
X-GUploader-UploadID: AEnB2UoPjuz3v6i-RioExWbgl1JULi-FqGuXlljVXfQBCa3Xg5aSAGm9SslQu1m2I9ITSE6223FgsNjTiBMr4aS-QBeDumyv89n87pAnPpII7wffRZtCW70
Date: Sat, 07 Apr 2018 18:18:55 GMT
Expires: Sun, 07 Apr 2019 18:18:55 GMT
Last-Modified: Sat, 07 Apr 2018 17:25:44 GMT
ETag: "0a8411662813a125f999edad6079d7a5"
x-goog-generation: 1523121944356178
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 41487
Content-Type: application/json
x-goog-hash: crc32c=x7F/0g==
x-goog-hash: md5=CoQRZigToSX5me2tYHnXpQ==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 41487
Server: UploadServer
Cache-Control: no-cache
Age: 57035
curl -I http://storage.googleapis.com/myappname.appspot.com/config/config.json
HTTP/1.1 200 OK
X-GUploader-UploadID: AEnB2UpWhRGTwxsME436eKKeSf507oBN4mfT9MZLknOVb92GdRmV-Cs8z8UTVDvoENIeN6fq9PL9A3HkRLgVIWJFhzfVM4Ysy4xz20ZS1Z-Ez18i1islc1o
Date: Wed, 04 Apr 2018 13:34:51 GMT
Expires: Thu, 04 Apr 2019 13:34:51 GMT
Last-Modified: Wed, 04 Apr 2018 07:14:23 GMT
ETag: "522c4e9f5f97873f930501b69da311cf"
x-goog-generation: 1522826063699049
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 40298
Content-Type: application/json
x-goog-hash: crc32c=ZhnEqg==
x-goog-hash: md5=UixOn1+Xhz+TBQG2naMRzw==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 40298
Server: UploadServer
Cache-Control: Cache-Control:no-cache
Age: 333838
它只是拒绝 return 最近对该文件所做的更改,即使在几个小时之后也是如此。
更新:跟踪路径
traceroute to storage.googleapis.com (216.58.197.80), 30 hops max, 60 byte packets
1 192.168.0.1 (192.168.0.1) 1.544 ms 1.582 ms 1.973 ms
2 10.247.0.1 (10.247.0.1) 5.637 ms 5.641 ms 5.624 ms
3 broadband.actcorp.in (202.83.20.173) 5.609 ms 6.521 ms 6.524 ms
4 broadband.actcorp.in (202.83.20.181) 6.520 ms 6.534 ms 6.941 ms
5 broadband.actcorp.in (202.83.20.50) 11.394 ms 11.889 ms 11.881 ms
6 72.14.194.18 (72.14.194.18) 45.704 ms 42.574 ms 42.644 ms
7 * 108.170.253.113 (108.170.253.113) 42.576 ms *
8 108.170.237.95 (108.170.237.95) 43.536 ms 108.170.236.197 (108.170.236.197) 45.852 ms 45.865 ms
9 maa03s21-in-f16.1e100.net (216.58.197.80) 45.847 ms 43.914 ms 45.781 ms
截至今天(4 月 10 日),我仍然看到:
Date: Wed, 04 Apr 2018 15:35:28 GMT
Expires: Thu, 04 Apr 2019 15:35:28 GMT
Last-Modified: Wed, 04 Apr 2018 07:14:23 GMT
ETag: "522c4e9f5f97873f930501b69da311cf"
x-goog-generation: 1522826063699049
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 40298
Content-Type: application/json
x-goog-hash: crc32c=ZhnEqg==
x-goog-hash: md5=UixOn1+Xhz+TBQG2naMRzw==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 40298
Server: UploadServer
Cache-Control: Cache-Control:no-cache
Age: 528505
但是,从我的办公室网络中,我看到了该文件的更新版本,但即使在那里它也不遵守 "no-cache" 指令并且偶尔会显示过时的数据。
免责声明,我在 Google 云平台支持部门工作,希望您觉得此信息有用。
Currently the engineering team is aware of this issue and they are currently investigating it with high priority.
注意:
The issue with Google Cloud Storage caching objects that are marked with cache-control: no-cache has been resolved as of 13:11 US/Pacific 2018-04-11. Objects marked with cache-control which may have been cached may be affected until Thursday 2018-04-19, but a workaround is available.
已提供解决方法:
- 使用云 CDN 的客户:将存储桶作为 HTTP(S) 负载均衡器后端的客户可以通过 gcloud or the cloud console 发出缓存失效来手动使缓存中的对象过期。
不使用 Cloud CDN 的客户:启用 Cloud CDN 将导致从 Cloud CDN 继续提供对象,这将解决该问题,因为 Cloud CDN 使用不同的设置。
这怎么可能?对于同一个文件,Date/Expires/Last-Modified headers 差异如此之大。即使此文件今天(4 月 8 日)被修改,它随机 return 4 月 7 日和之后的 4 月 3 日或 4 日!
curl -I http://storage.googleapis.com/myappname.appspot.com/config/config.json
HTTP/1.1 200 OK
X-GUploader-UploadID: AEnB2UoPjuz3v6i-RioExWbgl1JULi-FqGuXlljVXfQBCa3Xg5aSAGm9SslQu1m2I9ITSE6223FgsNjTiBMr4aS-QBeDumyv89n87pAnPpII7wffRZtCW70
Date: Sat, 07 Apr 2018 18:18:55 GMT
Expires: Sun, 07 Apr 2019 18:18:55 GMT
Last-Modified: Sat, 07 Apr 2018 17:25:44 GMT
ETag: "0a8411662813a125f999edad6079d7a5"
x-goog-generation: 1523121944356178
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 41487
Content-Type: application/json
x-goog-hash: crc32c=x7F/0g==
x-goog-hash: md5=CoQRZigToSX5me2tYHnXpQ==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 41487
Server: UploadServer
Cache-Control: no-cache
Age: 57035
curl -I http://storage.googleapis.com/myappname.appspot.com/config/config.json
HTTP/1.1 200 OK
X-GUploader-UploadID: AEnB2UpWhRGTwxsME436eKKeSf507oBN4mfT9MZLknOVb92GdRmV-Cs8z8UTVDvoENIeN6fq9PL9A3HkRLgVIWJFhzfVM4Ysy4xz20ZS1Z-Ez18i1islc1o
Date: Wed, 04 Apr 2018 13:34:51 GMT
Expires: Thu, 04 Apr 2019 13:34:51 GMT
Last-Modified: Wed, 04 Apr 2018 07:14:23 GMT
ETag: "522c4e9f5f97873f930501b69da311cf"
x-goog-generation: 1522826063699049
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 40298
Content-Type: application/json
x-goog-hash: crc32c=ZhnEqg==
x-goog-hash: md5=UixOn1+Xhz+TBQG2naMRzw==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 40298
Server: UploadServer
Cache-Control: Cache-Control:no-cache
Age: 333838
它只是拒绝 return 最近对该文件所做的更改,即使在几个小时之后也是如此。
更新:跟踪路径
traceroute to storage.googleapis.com (216.58.197.80), 30 hops max, 60 byte packets
1 192.168.0.1 (192.168.0.1) 1.544 ms 1.582 ms 1.973 ms
2 10.247.0.1 (10.247.0.1) 5.637 ms 5.641 ms 5.624 ms
3 broadband.actcorp.in (202.83.20.173) 5.609 ms 6.521 ms 6.524 ms
4 broadband.actcorp.in (202.83.20.181) 6.520 ms 6.534 ms 6.941 ms
5 broadband.actcorp.in (202.83.20.50) 11.394 ms 11.889 ms 11.881 ms
6 72.14.194.18 (72.14.194.18) 45.704 ms 42.574 ms 42.644 ms
7 * 108.170.253.113 (108.170.253.113) 42.576 ms *
8 108.170.237.95 (108.170.237.95) 43.536 ms 108.170.236.197 (108.170.236.197) 45.852 ms 45.865 ms
9 maa03s21-in-f16.1e100.net (216.58.197.80) 45.847 ms 43.914 ms 45.781 ms
截至今天(4 月 10 日),我仍然看到:
Date: Wed, 04 Apr 2018 15:35:28 GMT
Expires: Thu, 04 Apr 2019 15:35:28 GMT
Last-Modified: Wed, 04 Apr 2018 07:14:23 GMT
ETag: "522c4e9f5f97873f930501b69da311cf"
x-goog-generation: 1522826063699049
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 40298
Content-Type: application/json
x-goog-hash: crc32c=ZhnEqg==
x-goog-hash: md5=UixOn1+Xhz+TBQG2naMRzw==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 40298
Server: UploadServer
Cache-Control: Cache-Control:no-cache
Age: 528505
但是,从我的办公室网络中,我看到了该文件的更新版本,但即使在那里它也不遵守 "no-cache" 指令并且偶尔会显示过时的数据。
免责声明,我在 Google 云平台支持部门工作,希望您觉得此信息有用。
Currently the engineering team is aware of this issue and they are currently investigating it with high priority.
注意:
The issue with Google Cloud Storage caching objects that are marked with cache-control: no-cache has been resolved as of 13:11 US/Pacific 2018-04-11. Objects marked with cache-control which may have been cached may be affected until Thursday 2018-04-19, but a workaround is available.
已提供解决方法:
- 使用云 CDN 的客户:将存储桶作为 HTTP(S) 负载均衡器后端的客户可以通过 gcloud or the cloud console 发出缓存失效来手动使缓存中的对象过期。 不使用 Cloud CDN 的客户:启用 Cloud CDN 将导致从 Cloud CDN 继续提供对象,这将解决该问题,因为 Cloud CDN 使用不同的设置。