Optimal NGINX gzip_min_length tuned for performance?
LukaszJaro opened this issue · comments
Hi,
Seems to be bunch of data stating that compressing files over 1400 bytes is pointless due to the MTU being able to handle 1400 bytes max.
Here's a short discussion on it https://webmasters.stackexchange.com/questions/89943/should-i-compress-very-small-html-pages
Current boilerplate config is much less than that but I'm wondering is this optimal for performance( response time). Example is a autocomplete search using ajax(xhr) which returns 1.3kb uncompressed and 1.2kb compressed, depending on how aggressive the compression level is. Would this cause a slower response to the client due to compressing/cpu usage and better to not have any gzip encoding for such small responses?
server-configs-nginx/h5bp/web_performance/compression.conf
Lines 17 to 21 in 537a022
Thanks for opening this issue @LukaszJaro.
That being said I'm not sure it is the good place to ask such question...
Anyway, usually for the modern web, we consider that computer hosting browser are no more from 2000's and can handle compression much faster than latency + bitrate of network.
Regarding the server, if you want to optimize the optimization, it is actually recommended to compress at a build time and not jit.
H5BP does contain a template to handle that case (with the equivalent for brotli):