【问题标题】:Google Cloud Storage and gzip-encoded data when client does not declare gzip support with Accept-Encoding客户端未使用 Accept-Encoding 声明 gzip 支持时的 Google Cloud Storage 和 gzip 编码数据
【发布时间】:2013-08-10 20:42:06
【问题描述】:

我正在比较托管静态网站的各种选项。现在我在 Google App Engine 和 Google Cloud Storage 之间犹豫不决。

对于 App Engine,我从文档中了解到,可以仅为声明支持此功能的客户端(通过 HTTP Accept-Encoding 标头)压缩内容。

对于 Cloud Storage,我发现如果您上传压缩内容并将 Content-Encoding 字段设置为“gzip”,Cloud Storage 会正确地将其压缩后提供给声明支持该内容的客户端。我的问题是,当客户端对使用“gzip”内容编码存储的对象执行 GET 操作时,Cloud Engine 会发生什么情况,但客户端未在其请求中声明支持带有接受编码的 gzip 压缩数据?数据是即时解压缩的(这是我希望的),还是返回某种类型或错误,或者提供的数据是否已压缩(不是很好)?

【问题讨论】:

    标签: google-cloud-storage


    【解决方案1】:

    确实,您可以使用Content-Encoding: gzip 将对象存储在 Google Cloud Storage 中。如果对该对象的后续请求不包含 Accept-Encoding: gzip 标头,则该对象将即时解压缩,是的。

    (旁注:不应将 Content-Encoding 与 Content-Type 混淆,例如 application/gzip,它始终保持不变。)

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-19
    相关资源
    最近更新 更多