Brotli Compression - build nginx dynamic module - magento static optimization

Why we need to use Brotli?
Brotli Compressions are faster, smaller, so faster page load.

When the data of a website gets compressed faster and to a much smaller size, it takes up less bandwidth to load. Reduced bandwidth consumption translates to a faster page load.

NGINX, Inc. uses automated tooling to create the dynamic module packages for our official repositories. This tooling, called pkg-oss, can also be used to create installable packages for third‑party modules.

You can use the pkg‑oss tooling to create an installable package for any dynamic module. It also includes a script, build_module.sh, that automates the process, as an example of how to create an installable package with the correct dependency:

$ wget https://hg.nginx.org/pkg-oss/raw-file/default/build_module.sh
$ chmod a+x build_module.sh
$ ./build_module.sh --force-dynamic https://github.com/google/ngx_brotli.git
...
build_module.sh: INFO: Module packages created
/root/rpmbuild/RPMS/x86_64/nginx-module-brotli-1.17.6-1.el7.ngx.x86_64.rpm

Creating installable packages for dynamic modules:

https://www.nginx.com/blog/creating-installable-packages-dynamic-modules/

 

Brotli module configuration directives:

https://github.com/google/ngx_brotli#configuration-directives