Compression with Gzip and Brotli

Hey guys!

If I check my pagespeed on GTmetrix most of the html of a specific url is uncompressed. (35 kb compressed, 185 kb uncompressed)

Therefore I m not sure about the right settings. In my htaccess I have set gzip compression. Should I also enable Brotli on Cloudflare? Do both of them work together or should I only use one of them?

Really looking forward for some feedback.

Thanks and regards,

This part of compression will be done between Cloudflare and your Apache server.

This part of compression will be done between Cloudflare and your visitors.

So, it’s fine to enable Brotli on Cloudflare.


Thank you for your answer.

If I use brotli, Cloudflare hast to change the compression from gzip to brotli. Does this take time?

If I don’t enable brotli, which compression occurs between Cloudflare and my visitors? Also gzip or no compression?

Thank you in advance!



The conversion is done almost instantly so the users won’t feel any slowdown.

And even though you don’t enable Brotli, Cloudflare still needs to decode the HTTP traffic as uncompressed text after receiving the gzip compressed response from your server to do the traffic inspection, and then recompress the response as gzip back to the visitor (depending on the Accept-Encoding header value sent by the visitor, if the visitor does not request gzip compressed data then the traffic will be uncompressed).


Thank you for the explanation!

Then I ll use the mixture of gzip and brotli.

Have a nice day!

1 Like

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