This PR adds support for HTTP Compression for faster data transfer!
There are 3 default compressions used which are provided by the zlib i.e. br, gzip, deflate in the same order for perf.
Additionally, a user can also provide a custom compression handler if the client supports it.
Example -
import zstd from '@mongodb-js/zstd';
express.compression({
encodings: new Set(['zstd']),
compress: async (buffer) => await zstd.compress(buffer, 9); // don't go over 20!
});
This PR adds support for HTTP Compression for faster data transfer! There are 3 default compressions used which are provided by the
zlib
i.e.br
,gzip
,deflate
in the same order for perf.Additionally, a user can also provide a custom compression handler if the client supports it. Example -
Supported compressible content types -