ZcashFoundation / zcash-grant-system

The Zcash Foundation Grant System
https://grants.zfnd.org
MIT License
11 stars 8 forks source link

Use gzip compression #436

Closed dternyak closed 5 years ago

dternyak commented 5 years ago

Closes https://github.com/ZcashFoundation/zcash-grant-system/issues/435

What this does

Adds new compression middleware to GZIP static assets.

To test

  1. Run curl without accepting GZIP encoding: curl http://localhost:3000/static/bundle.js --silent --write-out "%{size_download}\n" --output /dev/null

  2. 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

  3. 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.

wbobeirne commented 5 years ago

Can confirm I'm seeing yuuuge improvements in bundle size. Thanks Daniel!