简体   繁体   中英

node.js compression middleware

when we use compression middleware in node.js. Is that compression happen in server side and decompression happen in client side which is in browser? If so, what utility support this decompression in client side?

Thanks.

Compression is indeed on the server-side and the opposite process is done on the client-side.

Compression is done generally only when the client sends proper header:

Accept-Encoding: gzip, deflate

This tells the server that the content can optionally be compressed using these algorithms.

Most browsers support it natively so you don't have to bother about that :)

If you intend to write your own browser/client, then take a look at deflate/gzip libraries for the language(s) you're using.

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