Setting up the brotli extension for PHP

The Brotli extension for PHP, integrates the Brotli compression algorithm for use in PHP. Brotli compression is similar to gzip but has a higher compression ratio - up to 30% bandwidth savings. However, it does have a slight drawback; it is slower. This can be worked around most effectively by pre-compressing resources before the web server needs them. Hence with a LAMP stack, using the Brotli PHP extension provides easy performance gains.