How to verify brotli in origin server?

If I use an external tool to test if my website serves content with brotli compression, of course the result is yes, because the testing utility receives content from Cloudflare. However, how can I ensure end-to-end brotli? That is, how can I test whether brotli is being used between Cloudflare and my origin server? I believe I’ve enabled brotli in Apache, but am unsure how to verify I did it correctly. There doesn’t seem to be a Cloudflare tool that will tell me whether or not my origin server supports brotli.

Thanks for any help. Sorry if this is the wrong forum. I’m a blind website admin, and this community forum page is a nightmare for screen reading software.

To verify if Brotli is being used between Cloudflare and your origin server, you can perform some diagnostic steps. Here are some steps you might follow:

  1. Check Origin Server Configuration: Ensure that you have enabled Brotli on your origin server correctly. Check the Apache web server configuration to ensure that the Brotli module is installed and enabled. Additionally, review your virtual host configuration to see if Brotli is enabled for the content you want to compress.
  2. Scan Traffic: You can use tools like Wireshark or tcpdump to analyze HTTP traffic between Cloudflare and your origin server. Look for packets containing HTTP headers related to compression, such as Content-Encoding: br for Brotli. If you see this header in packets coming from your origin server to Cloudflare, then Brotli is being used.
  3. Check HTTP Headers: You can use online tools or browser extensions that display HTTP headers to verify if Brotli compression is being used. When accessing your website through Cloudflare, check the HTTP headers sent by your origin server. Look for the Content-Encoding header and see if br for Brotli is present.
  4. Performance Analysis Tools: Some web performance analysis tools may indicate if Brotli compression is being used. For example, you can use online tools like Google’s PageSpeed Insights or GTmetrix to run an analysis of your website and check if Brotli compression is reported.

Keep in mind that Cloudflare configuration can influence the transmission of HTTP headers between Cloudflare and your origin server, so you may need to conduct multiple tests and consider other factors in your configuration.

1 Like

Thanks very much. Option 3, checking the headers, was what I needed to hear. I used this curl command:

curl -s -I -H 'Accept-Encoding: br,gzip,deflate' https://example.com

The curl command you used sends a request to the specified URL (https://example.com) and includes an Accept-Encoding header that informs the server that the client supports Brotli, gzip, and deflate compression. However, the server can choose to respond with a different compression or no compression at all depending on its configuration.

To verify if the server is actually using Brotli compression, you need to check the server’s response to see if the Content-Encoding header includes br as an indicator of Brotli.

Here’s an example of how to run the curl command to check HTTP headers:

curl -s -I -H 'Accept-Encoding: br,gzip,deflate' https://example.com

After running this command, look for the Content-Encoding header in the server’s response. If you see br in the Content-Encoding header, it means the server is using Brotli compression for the response. If you don’t see br , the server may not support Brotli compression or may not be configured to use it for the specific request.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.