Skip to main content
Brotli is a modern compression algorithm developed by Google, designed to compress web content more efficiently. Introduced in 2015, Brotli is now supported by all major browsers and is widely adopted across modern web infrastructure. Compression plays a critical role in web performance by reducing file sizes before they are transmitted to users. Smaller files mean faster downloads, lower bandwidth usage, and improved page load times. Brotli is particularly effective at compressing static assets such as CSS, JavaScript, fonts, and images, where its higher compression ratio can provide significant savings. Brotli supports both static compression (where files are pre-compressed at build time) and dynamic compression (where files are compressed on-the-fly by the server). Static compression is recommended for production environments, while dynamic compression is used when static files are not pre-compressed. In ORIV environments, Brotli is automatically enabled on NGINX servers, ensuring all eligible files benefit from this advanced compression algorithm without requiring manual intervention. However, if you’re using Cloudflare, you can use Brotli compression on both NGINX and OpenLiteSpeed (OLS) servers. This provides flexibility for Cloudflare users to take advantage of Brotli’s benefits, regardless of the server platform. Note: Brotli is automatically installed on the new servers. However, it is not installed on the old servers for now.

Configuring Brotli For Your Site

If you want to access Brotli, you’ll need to make sure your site is using HTTPS (SSL). Brotli only works with secure connections, so be sure to get your SSL certificate set up first. Once enabled, these are the default settings for Brotli you will get :

Verifying if Brotli is Working on Your Website

To ensure Brotli is working on your site, you can use various online tools to test your website’s compression. One of the simplest ways to verify is by using the Gift of Speed Gzip test tool, which also checks Brotli compression. Here’s how you can verify if Brotli is enabled:
  1. Go to Gift of Speed Gzip Test.
  2. Enter your website URL and click “Test Your Site.”
  3. Once the test is complete, look at the Content-Encoding header in the response.
[!NOTE] Precisa de ajuda visual para esta etapa? Entre em contato com o nosso suporte em support@oriv.cloud.
If Brotli is working correctly, you should see br listed as the encoding method. For example: Content-Encoding: br If you see gzip or deflate, it means Brotli is not enabled or being used. If br is present, you know that Brotli is successfully compressing your assets.

Verifying Brotli Using Command Line

Alternatively, you can verify if Brotli is working using the command line with curl. Here are some commands to help you check for Brotli or Gzip compression:
  1. Check for Gzip CompressionRun the following command to see if Gzip is enabled:
If Gzip is enabled, you will see:
  1. Check for Brotli CompressionRun the following command to see if Brotli is enabled:
If Brotli is enabled, you will see:
  • Content-Encoding: br
  1. Check for Both (Gzip and Brotli) at OnceIf you want to check for both compression types, run:
If both are supported, the response might be:
or
The server typically chooses the best compression method, and Brotli is preferred if both are available.
  1. Check for Compression with Full RequestIf you want to view the full response headers, use this command:
Brotli compression is a powerful tool to enhance your performance by reducing file sizes and improving page speed. With automatic configuration and smart optimization with ORIV, your applications benefit from Brotli’s efficiency without requiring manual setup. Still stuck? Contact ourdedicated support teamfor any of your queries.