Gem 又拍云 latest_specs 缓存太旧了

jhjguxin · 发布于 2016年08月09日 · 最后由 huacnlee 回复于 2016年08月09日 · 1059 次阅读
686

今天上服务器 更新一下 gem 发现 sprockets 3.7.0 死活升级不过

手动执行结果如下

gem install sprockets -V -v 3.7.0 --source=https://gems.ruby-china.org/
GET https://gems.ruby-china.org/specs.4.8.gz
302 Moved Temporarily
GET https://gems-ruby-china.b0.upaiyun.com/specs.4.8.gz
304 Not Modified
ERROR:  Could not find a valid gem 'sprockets' (= 3.7.0) in any repository
GET https://gems.ruby-china.org/prerelease_specs.4.8.gz
302 Moved Temporarily
GET https://gems-ruby-china.b0.upaiyun.com/prerelease_specs.4.8.gz
304 Not Modified

然后检查 sprockets-3.7.0.gemspec.rz 结果正常

curl -I https://gems-ruby-china.b0.upaiyun.com/quick/Marshal.4.8/sprockets-3.7.0.gemspec.rz
HTTP/1.1 200 OK
Server: marco/0.17
Date: Tue, 09 Aug 2016 12:21:48 GMT
Content-Type: application/octet-stream
Content-Length: 704
Connection: keep-alive
X-Source: C/200
X-Proxy-Route: abroad, abroad
X-Amz-Replication-Status: PENDING
X-Served-By: cache-sea1927-SEA, cache-hkg6826-HKG
ETag: "a8d03cc13380014310a6e53a28068a28"
X-Amz-Request-Id: C26F5C712BEB6C7C
X-Cache-Hits: 1, 1
X-Amz-Version-Id: N_PvGrirliSE9_fQoQoz0CpsiLrpsHIx
Last-Modified: Thu, 21 Jul 2016 15:39:27 GMT
X-Amz-Id-2: zSq489nkQVoRHf5P0TJqtjUor93Xim2lrT2xXMop61vLgihogM99wXB1DgEyOEaYS6Eu57df/tQ=
Fastly-Debug-Digest: fa4e31d4fa8873dc9530e73cf74017198aba19301568e0358f70c3d807a21b3c
Age: 1629660
Accept-Ranges: bytes
Expires: Fri, 21 Jul 2017 16:24:14 GMT
Cache-Control: max-age=31536000
X-Cache: HIT from mix-hz-fdi-170; HIT from ctn-zj-lna-200
X-Request-Id: 83df2159d16c24f156b9c776aac8d9a0; 55fe3700ca4f5457e24bf62d1971911e
Via: S.mix-hz-fdi-171, T.101169.H.1, V.mix-hz-fdi-170, T.101202.H.1, M.ctn-zj-lna-200

最后 仔细看了一下 又拍云的 latest_specs.4.8.gz

curl -I https://gems-ruby-china.b0.upaiyun.com/latest_specs.4.8.gz
HTTP/1.1 200 OK
Server: marco/0.17
Date: Tue, 09 Aug 2016 12:20:38 GMT
Content-Type: application/octet-stream
Content-Length: 1007041
Connection: keep-alive
X-Source: U/200
X-Cache: MISS(S)|MISS from 403-zj-fud-207, MISS from mix-hz-fdi-171; HIT(R) from ctn-zj-lna-200
Cache-Control: max-age=667460
Etag: "9343fd14667b5d6e5e17b5285176d972"
X-Last-Content-Length: 1007041
X-Upyun-Created-Date: Mon, 27 Jun 2016 09:11:27 GMT
Expires: Tue, 16 Aug 2016 20:20:22 GMT
X-Request-Id: a68a4a5abf3497449206dc205d7bdb47; d045b2eeddba047615359fae7f8d62d5
Last-Modified: Mon, 27 Jun 2016 09:00:46 GMT
Age: 33876
Accept-Ranges: bytes
Via: T.5209.S.2, T.5209.M.1, V.403-zj-fud-207, S.mix-hz-fdi-168, T.101172.M.1, V.mix-hz-fdi-171, T.101200.R.1, M.ctn-zj-lna-200

发现 又拍云创建时间是 X-Upyun-Created-Date: Mon, 27 Jun 2016 09:11:27 GMT 过期时间是 Expires: Tue, 16 Aug 2016 20:20:22 GMT 那么这期间的更新就没有了 着时间跨度似乎有点太长了吧 😭 @huacnlee 看看 是不是得处理一下

共收到 2 条回复
686

更新一下 ruby.taobao.org 还能安装 XD

gem install sprockets -v 3.7.0  --source=https://ruby.taobao.org/
Successfully installed sprockets-3.7.0
1 gem installed
De6df3

谢谢提醒,之前只请求了 /specs.4.8 看没什么内容以为没东西,所以就缓存了。原来内容都在 /specs.4.8.gz 里面。

刚刚已经调整了一下配置,设置这个文件以及其他 *.4.8.gz 的文件缓存有效期 15 分钟。

$ curl -I https://gems-ruby-china.b0.upaiyun.com/specs.4.8.gz
HTTP/1.1 200 OK
Date: Tue, 09 Aug 2016 15:53:01 GMT
Content-Type: application/octet-stream
Content-Length: 2931016
Connection: keep-alive
X-Source: C/200
X-Proxy-Route: abroad, abroad
X-Amz-Replication-Status: PENDING
X-Served-By: cache-sea1925-SEA, cache-hkg6820-HKG
ETag: "10b0f11916651abcdff67d844ccdf0fa"
Last-Modified: Tue, 09 Aug 2016 15:46:09 GMT
X-Amz-Request-Id: B7B0BD79C77ED8F8
X-Cache-Hits: 3, 5
X-Amz-Meta-Surrogate-Key: full-index
X-Amz-Version-Id: bKe5TEe_iesHzrtnHXQNe44p3uc5.6hh
Accept-Ranges: bytes
Fastly-Debug-Digest: 0debb0ceabb31d16abb864478a5071786f8f67d8d7863ea1fe1be712493ee2ac
Age: 406
X-Amz-Id-2: nPgfOG/fK7ssxFUbJNTzOiduwZgU4XQCmCNSmfhXK0Lnc65w84v6zsQ6F6dQ+6yEjO7zZF30skQ=
Expires: Tue, 09 Aug 2016 16:08:01 GMT
Cache-Control: max-age=900
X-Shanks-Origin-Trace: abroad/transfer-abroad.upyun.com:404/200
X-Cache: MISS from mix-hz-fdi-166, MISS from ctn-sc-mei1-016
X-Request-Id: fedd3161abb5993e00168413fbdde101
Via: S.mix-hz-fdi-167, T.101163.M.1, V.mix-hz-fdi-166, T.12510.M.1, M.ctn-sc-mei1-016
De6df3 huacnlee 关闭了讨论 08月09日 23:53
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册