Enable Brotli Compression for Xenforo 2

Enable Brotli Compression for Xenforo 2

Brotli Compression.webp


Just like Gzip, Brotli is also a generic-purpose compression algorithm developed by Google. It compresses data using a combination of modern technologies and algorithms. It is similar in speed to deflate but provides higher compression. Brotli compression is supported by all the major browsers like Chrome, Firefox, Safari, Edge.

This tutorial helps you to enable brotli compression in the Apache webserver and Xenforo 2.

Brotli Test.webp


Here's how you can enable Brotli compression on Apache - also known as apache2:

1. Installing Brotli Module:

sudo apt install brotli

2. Enable the Brotli module:
sudo a2enmod brotli

3. Configure Brotli Compression:
Next, you'll need to configure Apache to use Brotli compression. To do this, you'll need to add the following code to your Apache configuration file:
Code:
You must log in to view
(4 lines)

Note: If you are using DEFLATE mod, please remove its configuration lines.

4. Error checking:
sudo apache2ctl configtest

5. Restart the Apache server:
sudo systemctl reload apache2

6. Disable enableGzip on Xenforo 2
Open file src/config.php. Add the following line:
$config['enableGzip'] = false;

7. Test Brotli Compression:
https://tools.keycdn.com/brotli-test
 
Top