Compress Payload in NodeJS
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrFIr6plG0IeEr5epXzixuqmABNFdAwJ994GYVJpO3AEqDsdIHI8C5yrtjnUC3n8WPCTuy5iAmi-7AAAHKd-Sf8X3NB2gTQieAd2sAeVri2INvnpEBnKrmoC1hgTgTRU2glAGPNRoV9qo/w640-h300/without_compression.png)
Compress Payload (response) in NodeJS Compression in Node.js and Express.js decreases the amount of downloadable data from a website or app. By using this compression, we can improve the performance of our Node.js applications as our payload size is dramatically reduced above 70% . Compression generally refers to code that has been modified using a data compression algorithm. Unlike minification that ends up providing perfectly valid code, compressed code must be unzipped before use. There are many text compression algorithms, but there are only 3 supported algorithms for compression (and decompression ) of HTTP requests: Deflate ( deflate ): Not commonly used. Gzip ( gzip ): The most widely used compression format for server and client interactions. It is based on the Deflate algorithm and is compatible with all current browsers. Brotli ( br ): A newer compress...