Html compression not working

Not sure what to do. I’m running tests in lighthouse and it keeps telling me my pages are not compressed and my js is not minified. I have selected Brotli compression…


Hi @darseyaraneda!

I think you might be confusing compression and minification. Both are methods of reducing the amount of data transferred but they work very differently.

Minification is the process of removing unnecessary whitespace and comments from JavaScript, CSS and HTML without altering how it is interpreted by the browser. Minification can be turned on in the Cloudflare dashboard → Speed → Optimization and you can read more about it here.

Compression, in the context of websites, works at the transport level and does not modify the resource at all. Compression is a pretty complex technology which I am in no way qualified or knowledgeable enough to explain. In case you are interested in learning more, try searching for "how does lossless compression work". You can read more about what and when Cloudflare will compress here.


Hi Albert! Thanks for responding…

My problem is that I have enabled text compression through Cloudflare and in my htaccess file and when I test my site on Lighthouse or Google PageInsights it tells me I need to “Enable Text Compression” so something isn’t working.

It also tells me I need to “Minify Javascript” which is also turned on in Cloudflare.

What could be going wrong that these two things are not working but both are enabled?


Unfortunately, from my experience that tool will always say the same despite of 100% HTML minification (at origin server or Cloudflare Auto Minfiy) and despite of using either gzip or brotli :confused:

Hm, if you take a closer look, maybe the mentioned resources are external and/or 3rd-party? :thinking: , if yes, then Cloudflare cannot take effect over them as they aren’t served/pulled and being a part of your domain name (which uses Cloudflare service/features).

Kindly, can you share the example of the URL which you were testing? :thinking:

Nevertheless, for the end user / visitor of your website, nowaday Web browsers do support and are compatible with the options/features which you have enabled at Cloudflare for your domain (Brotli, HTTP/2, HTTP/3, 0-RTT, Rocket Loader, Auto Minify), therefore I would not worry much about what the tool says as long as in real web browser those things do work :wink:


OK! Thanks… this is all so confusing… :laughing:

My URL is:

It’s just that I’m working on my SEO and my page score at PageInsights for Mobile is a bit low and showing as “Failed” so I’m trying to correct as much as possible. I’ve also delayed loading of the adsense scripts which for some reason still show up as being loaded… :upside_down_face:

I guess one issue at a time…

… you really don’t want me to show you mine page score for mobile, also “failed” :laughing: :sweat_smile:, but the website is loading pretty fast enough for the visitor/end-user, while SEO score is maintained between 90-95 :slight_smile:

Yep, will always “complain” and throw “issue” for it …
It’s impossible to get 100 / 100 using that tool, except if we exclude external 3rd-party scripts and fonts and advertisements (like Google AdSense).

Agree :+1:

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