2.7.5. Gzip and brotli compression

Attention!

Files at least 2 KB in size are compressed. Smaller files are not compressed, as it is inefficient.

Compression is performed by means of nginx server and is enabled by default for all sites hosted on shared and business hosting.

The compression algorithm is selected depending on the protocol used and the availability of client-side support:

  • Brotli — used under the following conditions:
    1. The algorithm is supported on the client side — the browser sends the Accept-Encoding header with the br directive.
    2. The connection is over HTTPS - browsers intentionally do not allow brotli when using HTTP because of the risk of data corruption by proxy servers.
  • Gzip — used in other cases (compression level — 5).

Configuring compression via Apache server using mod_deflate and directives in .htaccess is not recommended, as it may increase the load on the web server and will not increase the site loading speed. If you still need to do this, when adding compression directives to .htaccess, remove the compressed file extensions from the static files list.

Content

    (2)