compress = true ignored when below treshold
jesperp opened this issue · comments
Jesper commented
Although docs says
You can always enable compression by setting this.compress = true
Mistake in docs or code? :)
jongleberry commented
It should ignore threshold. Does it not?
Jesper commented
no, this.compress is not checked
if (threshold && this.response.length < threshold) return
Jeremiah Senkpiel commented
@jesperp see https://github.com/koajs/compress/blob/master/index.js#L55
and https://github.com/koajs/compress/blob/master/index.js#L44
this.compress
does not force compression below the threshold. It merely bypasses the filter, or enables on a file-by-file level.
Jesper commented
gotcha
Jeremiah Senkpiel commented
@jesperp Apologies, let me correct myself, that should have been below the threshold.
i.e. the threshold is for files that are too small to bother with.