Trendy Issue: Enable Brotli Compression [WIP] #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Github Issue: https://github.com/shiftcommerce/trendy-golf/issues/60
This PR enables brotli and gzip compression via the
shrink-ray-current
library. Ideally, this should be replaced withcompression js
when this issue is resolved - expressjs/compression#71PR also bumps the package version to
v0.14.0
.Caveat:
The
shrink-ray-current
library utilisesnode-zopfli-es
when gzipping static file. However, this is an option dependency and since it is (~100x slower than gzip) we have not included it. As such, we will see some warnings in the console eg. -QA
Checkout Shift Frontend React branch
trendy-issue/60_enable_brotli2
and boot appNavigate to
http://localhost:3000
In the chrome developer tools - network tab, check that the
Content-Encoding
isbr