You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider using a buffer for the response and only doing the GZIP compression at the end when the amount of bytes to be written exceeds a threshold. See:
I came here because the middleware is compressing empty body responses (as in header-only responses). This doesn't seem to be right, though, since the Content-Length for an empty body is obviously zero and a compressed empty response has the gzip header overhead (looks like 23 bytes).
Also in the case of zero-length compressed responses, it forces the client to actually decompress the response body (which will then be empty), consuming unnecessary processing time.
Consider using a buffer for the response and only doing the GZIP compression at the end when the amount of bytes to be written exceeds a threshold. See:
http://webmasters.stackexchange.com/questions/31750/what-is-recommended-minimum-object-size-for-gzip-performance-benefits
The text was updated successfully, but these errors were encountered: