BufBills
BufBills

Reputation: 8103

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.

Upvotes: 0

Views: 165

Answers (1)

avetisk
avetisk

Reputation: 12319

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.

Upvotes: 2

Related Questions