expressjs / compression

Node.js compression middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why does the data size increase after compression

yuexiangqianlong opened this issue · comments

This is a question of how compression formats work in general and not an issue with this module. The binary format has overhead, and if the contents cannot be compressed enough to at least make up the space needed for the compression format overhead, the total size will end up being larger.

There are two methods to help with this: this module provides the threshold option to not bother compressing small responses, which tend to be larger when compressed and the filter option to not compress non compressible responses.