Documentation

Visit Our xCloud Knowledge Base

Here is your one-stop source for in-depth articles, FAQs, and tutorials for you to excel at hosting & managing your websites.


Brotli Compression on xCloud And Configuring For Your Site

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 xCloud 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 :

brotli on;
brotli_static on;
brotli_comp_level 4;
brotli_types application/atom+xml
  application/javascript
  application/json
  application/ld+json
  application/manifest+json
  application/vnd.geo+json
  application/vnd.ms-fontobject
  application/x-font-opentype
  application/x-font-truetype
  application/x-font-ttf
  application/x-javascript
  application/x-web-app-manifest+json
  application/xhtml+xml
  application/xml
  application/xml+rss
  image/bmp
  font/eot
  font/opentype
  font/otf
  image/svg+xml
  image/vnd.microsoft.icon
  image/x-win-bitmap
  image/x-icon
  text/cache-manifest
  text/css
  text/javascript
  text/plain
  text/vcard
  text/vnd.rim.location.xloc
  text/vtt
  text/x-component
  text/x-cross-domain-policy
  text/xml;

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.

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 Compression
    Run the following command to see if Gzip is enabled:
curl -s -I -H "Accept-Encoding: gzip" https://example.com | grep -i "content-encoding"

If Gzip is enabled, you will see:

Content-Encoding: gzip
  1. Check for Brotli Compression
    Run the following command to see if Brotli is enabled:
curl -s -I -H "Accept-Encoding: br" https://example.com | grep -i "content-encoding"

If Brotli is enabled, you will see:

  • Content-Encoding: br
  1. Check for Both (Gzip and Brotli) at Once
    If you want to check for both compression types, run:
curl -s -I -H "Accept-Encoding: gzip, br" https://example.com | grep -i "content-encoding"

If both are supported, the response might be:

Content-Encoding: br

or

Content-Encoding: gzip

The server typically chooses the best compression method, and Brotli is preferred if both are available.

  1. Check for Compression with Full Request
    If you want to view the full response headers, use this command:
curl -s -H "Accept-Encoding: gzip, br" -D - https://example.com -o /dev/null

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 xCloud, your applications benefit from Brotli’s efficiency without requiring manual setup. 

Still stuck? Contact our dedicated support team for any of your queries.

What are your feelings
Updated on March 12, 2025

Server Name

RAM

SSD

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Newcomer

1GB

25GB

$4.50

$5.00

$6.00

Basic

2GB

55GB

$9.00

$10

$12.00

Standard

4GB

80GB

$18.00

$20

$24.00

Professional

8GB

160GB

$36.00

$40

$48.00

Business

16GB

320GB

$72.00

$80

$96.00

Server Name

RAM

SSD/NVMe

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Lite

1GB

32GB

$5.40

$6.00

$8.00

Personal

2GB

88GB

$16.20

$18.00

$24.00

Growing

4GB

128GB

$21.60

$24.00

$32.00

Elite

8GB

256GB

$43.20

$48.00

$64.00

Titanium

8GB

384GB

$86.40

$96.00

$96.00

Ultimate

32GB

512GB

$172.80

$192.00

$192.00