Disable Brotli Compression on a Per Account/Domain Basis

As of LiteSpeed Web Server v5.2.2, Brotli compression can be disabled on a per account/domain basis through Apache configuration and .htaccess files. In previous versions, Brotli could only be disabled server wide.

LiteSpeed Web Server

  1. Log in to the LSWS Web Admin GUI and navigate to Configuration > Virtual Hosts


  2. Select a virtual host and click on the General tab


  3. Scroll down to the Apache Style Configurations setting and click Edit


  4. Add the following to the text box: SetEnv no-brotli


  5. Save and perform a Graceful Restart to apply these changes. The virtual host should no longer be using brotli compression.


cPanel/WHM

The ‘no-brotli’ tag can be enabled selectively through virtual host include files, such as:

  • Without SSL: /etc/apache2/conf.d/userdata/std/2_4/$USER/yourdomain.com/brotli.conf
  • With SSL: /etc/apache2/conf.d/userdata/ssl/2_4/$USER/yourdomain.com/brotli.conf

By adding the following block:

<IfModule LiteSpeed>
    SetEnv no-brotli
</IfModule>

Perform a Graceful Restart to apply these changes. The account should no longer be using brotli compression.

Note: For more information on how to edit virtual host include files please see How To Modify Virtualhost Containers With Include Files in cPanel documentation.

.htaccess

To disable brotli compression via an .htaccess file, simply add:

SetEnv no-brotli

This method allows brotli compression to be disabled for certain sub folders/files without the need for a Graceful Restart.

 
litespeed_wiki/config/brotli/disable-per.txt · Last modified: 2017/10/24 12:55 by Lisa Clarke