简体   繁体   中英

How to enable gzip compression on YAWS?

How do I enable gzip compression on yaws?

I have this information:

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).

The thing is that I do not know where to add yaws:outh_set_vary(Fields) or how to return {header, {vary, Fields}}.

The easiest thing to do is set deflate = true in the server block of your yaws.conf config file to enable deflate compression for that server. See the Yaws config documentation for more details about deflate , including an explanation of the optional <deflate> ... </deflate> block for customizing server compression settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM