jquery / codeorigin.jquery.com

jQuery CDN
https://releases.jquery.com
Other
57 stars 602 forks source link

Increase gzip compression level #38

Closed niutech closed 4 years ago

niutech commented 6 years ago

I have tested the latest jQuery version at code.jquery.com using Gzip and Brotli Compression Level Estimator and there is room for improvement:

jquery test

Please increase the gzip compression level from 1 to at least 6 and enable brotli compression method. Thanks.

divinity76 commented 5 years ago

actually, make it 9 and serve it pre-compressed. by default, nginx compresses it on-the-go every time it's fetched, which i guess justifies the level 1 compression. check the ngx_http_gzip_static_module, it allows you to save the file as file.gz, and nginx will look for file.gz and serve that as pre-compressed if present. that, even at max gzip compression level will be a lot faster than serving it with level 1 compression on the go (which is how nginx works by default), now it's just a fopen() sendfile() fclose()~

(also, if you're worried about web browsers that doesn't support gzip-compression (wtf, does that even exist?), there is also the ngx_http_gunzip_module which will decompress it on-the-go if the client didn't specify Accept-Encoding: gzip )

Krinkle commented 4 years ago

I have checked in the Highwinds StrikeTracker, which is configuration panel for the StackPath CDN service we use on code.jquery.org, and there is indeed an optoin to tune the Gzip compression level.

However, according to the settings there these are already set at the highest. The system they use ranges from 0-6 (rather than 1-9) where 0 is faster without compression and 6 is the highest compression, which is the setting we already use for code.jquery.com.

CDN: code.jquery.org / Compression
capture
XhmikosR commented 4 years ago

At some point in the past, I had requested StackPath for this change so maybe it was applied back then. There's nothing more you can do, since last time I checked, they didn't offer Brotli compression.