【问题标题】:How to enable gzip compression on YAWS?如何在 YAWS 上启用 gzip 压缩?
【发布时间】:2018-08-20 22:39:59
【问题描述】:

如何在 yaws 上启用 gzip 压缩?

我有这些信息:

With this patch, Yaws will add 'Accept-Encoding' in 'Vary' header if the
    support of gzip compression is enabled or if the response is compressed.
    The 'Vary' header can be set using 'yaws:outh_set_vary(Fields)' or by
    returning '{header, {vary, Fields}}' from scripts (where Fields is a list
    of header names).

问题是我不知道在哪里添加 yaws:outh_set_vary(Fields) 或如何返回 {header, {vary, Fields}}。

【问题讨论】:

    标签: gzip yaws


    【解决方案1】:

    最简单的做法是在yaws.conf 配置文件的服务器块中设置deflate = true,以启用该服务器的deflate 压缩。有关deflate 的更多详细信息,请参阅the Yaws config documentation,包括对用于自定义服务器压缩设置的可选<deflate> ... </deflate> 块的说明。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-17
      • 2021-10-03
      • 1970-01-01
      • 2013-12-29
      • 2015-02-15
      • 1970-01-01
      • 2015-12-01
      • 1970-01-01
      相关资源
      最近更新 更多