4

I would like to use Brotli compression for my node application built on express. I deliver content (HTML, CSS and JS) with app.use(express.static('public')).

I have found the shrink-ray module which does Brotli compression perfectly. However, when I install it and run the nsp check from the node security platform module, I get security vulnerabilities, which makes it impossible to use in my project.

Does anyone know a good alternative to enable Brotli compression on a node app using express? I´ve tried express-static-gzip but didn´t manage to make it work, it was still gzipped even on a simple tutorial.

3
  • Have you tried enableBrotli option in express-static-gzip ? Jul 30, 2018 at 13:47
  • Yes, but it was still gzip compression with no size reduction
    – Stefan
    Jul 30, 2018 at 14:44
  • enableBrotli option only works if you have the brotli file already available. You can read this article to learn how to use use that option. codeburst.io/express-brotli-webpack-a60773e7ec6c
    – Jose Rego
    Dec 20, 2018 at 16:56

1 Answer 1

7

The new shrink-ray-current module is an alternative that works with updated dependencies.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.