Closed dternyak closed 5 years ago
Closes https://github.com/ZcashFoundation/zcash-grant-system/issues/435
Adds new compression middleware to GZIP static assets.
compression
Run curl without accepting GZIP encoding: curl http://localhost:3000/static/bundle.js --silent --write-out "%{size_download}\n" --output /dev/null
curl http://localhost:3000/static/bundle.js --silent --write-out "%{size_download}\n" --output /dev/null
Run curl with gzip encoding accepted: curl http://localhost:3000/static/bundle.js --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null
curl http://localhost:3000/static/bundle.js --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null
Confirm that gzip encoded download size is ~50% of original.
For some reason, I'm unable to get a Content-Encoding header back from express, but the content seems gzipped nonetheless.
Content-Encoding
Can confirm I'm seeing yuuuge improvements in bundle size. Thanks Daniel!
Closes https://github.com/ZcashFoundation/zcash-grant-system/issues/435
What this does
Adds new
compression
middleware to GZIP static assets.To test
Run curl without accepting GZIP encoding:
curl http://localhost:3000/static/bundle.js --silent --write-out "%{size_download}\n" --output /dev/null
Run curl with gzip encoding accepted:
curl http://localhost:3000/static/bundle.js --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null
Confirm that gzip encoded download size is ~50% of original.
What's missing
For some reason, I'm unable to get a
Content-Encoding
header back from express, but the content seems gzipped nonetheless.