With gzip no longer activating through alchemist, we need a way to make the compression happen. I'm actually kind of glad that this can be a separate piece of middleware, it feels like it belongs that way.
This guy comes with sort of a "secret option" - while most people want to turn on gzip and have everything compressed (which you can do by passing gzip: true as before), you can actually set a threshold for content size, that if exceeded, the content will be gzipped. Pretty nice. You can activate this by passing { threshold: 1000 } to the gzip option rather than a boolean.
With gzip no longer activating through alchemist, we need a way to make the compression happen. I'm actually kind of glad that this can be a separate piece of middleware, it feels like it belongs that way.
This guy comes with sort of a "secret option" - while most people want to turn on gzip and have everything compressed (which you can do by passing
gzip: true
as before), you can actually set a threshold for content size, that if exceeded, the content will be gzipped. Pretty nice. You can activate this by passing{ threshold: 1000 }
to thegzip
option rather than a boolean.