GZip middleware lacks tests and sends compressed responses when larger than the original
|Reported by:||Aaron Cannon||Owned by:||Aymeric Augustin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The GZip middleware does not currently have any tests.
In addition, in some cases it is not efficient to send a compressed response when the data doesn't compress. After the data is compressed, a check should be performed to see if the compressed data is equal to or larger than the original data, and if so, the original data should be returned instead of the compressed data. This will save a minuscule amount of bandwidth, but it will also save the recipient from having to decompress data.