Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trendy Issue: Enable Brotli Compression [WIP] #79

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mufudzimasaire
Copy link
Contributor

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 with compression js when this issue is resolved - expressjs/compression#71

PR also bumps the package version to v0.14.0.

Caveat:

The shrink-ray-current library utilises node-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. -

$ NODE_ENV=production node server/server.js
(node:6323) [ZOPFLI_COMPAT] MISSING_MODULE: Module "node-zopfli-es" was unavailable
Zopfli compression unavailable; will fall back to gzip.
> Ready on http://localhost:3000

QA

  1. Checkout Shift Frontend React branch trendy-issue/60_enable_brotli2 and boot app

  2. Navigate to http://localhost:3000

  3. In the chrome developer tools - network tab, check that the Content-Encoding is br

Brotli compression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant