Minifying JS files

Why Wait
Don’t wait for an answer, find it fast! Search for #CommunityTip error:
Example: #CommunityTip 521

Test Before You Post
Unsure of the issue? Test before posting using the Cloudflare Diagnostic Center:

Hi CF Community,

Good day!
I’m having issues fixing the minification of javascript files in my site, here are the details:

  • Website is using wordpress.
  • NitroPack is the plugin for caching.
  • I already read the guide why my javascript files are not being minified as it has cookie in its response header.
  • Yet I follow the suggested process in this link (CSS minify not working?) mainly about page rules and assigning it with cache level = cache everything and edge ttl for a month.

RedBot result:

Still when I tried to run the SemRush crawler I still got the issue about javascript files not minified. I know you can help me guys and thanks in advance.

Hi @simon, I tagged you since I believe you’re the one that suggested the guide on the attached link above. Thank you!

Hi Romel,

The headers confirm we are minifying:

Cf-Bgj: minify
Cf-Polished: origSize=2355

That tells you we minified the response and the original file size was 2355 bytes. Our response should be smaller than that, due to minification. Why Semrush is detecting something different is something you’d need to check with them. You can also test with for example which I believe does check minification, too and I imagine will show a positive result.

Hi Simon,

Good day!
Thank you for your time with my question and apologies as well for my late response.
Yeah, after I did my updates as I listed on my first comment above, Semrush still detects that the site is still accessing unminified js/css files. With some more reading I found that there’s a setting inside Speed tab regarding JS and CSS optimzation and I reckon that fixes my problem.

Thanks again for your time.

This topic was automatically closed after 30 days. New replies are no longer allowed.