expressjs / compression

Node.js compression middleware
MIT License
2.77k stars 241 forks source link

What's the minimum size for a response to be compressed? #118

Closed loganhuskins closed 7 years ago

loganhuskins commented 7 years ago

It looks like compression only happens when a response is over a (very small) size limit. What's that size limit if that's the case? Is it documented anywhere? If not, I can add it for everyone.

dougwilson commented 7 years ago

It is 1kb. From the README (https://github.com/expressjs/compression#threshold):

The byte threshold for the response body size before compression is considered for the response, defaults to 1kb.

loganhuskins commented 7 years ago

Must have missed it, sorry.

dougwilson commented 7 years ago

It's no problem at all :) I only pointed out where it was in the docs since you were asking about the docs in addition to what it was :)