Mondoze Knowledge Base

Search our articles or browse by category below

Why isn’t Auto Minify working?

Last modified: October 5, 2022
You are here:
Estimated reading time: 1 min

Why isn't Auto Minify working?

Once enabled, Cloudflare’s Auto minify will minify your HTML and your cached CSS & JS files. If you view the source of your files in your web browser or via a command line tool such as cURL and you do not see the code being minified – here are some things you should check:

  • Only files that are serve via your orange-cloud DNS records will be minify – so code on 3rd party domains that are not using Cloudflare will not be minify
  • For CSS & JS only cache HITs will be minified – use this guide to check an individual file’s cache status.
  • The feature will deliberately skip minification for files that contain .min in their name
  • If your code has fatal syntax errors, auto minify may not be able to successfully minify the code – use the syntax checkers below on your files to confirm this
  • We will not minify inline js/css inside your html

If you want to manually confirm whether your files are getting minify, you can use a tool such as cURL to compare the response with and without Cloudflare – use this guide to learn how to do that or you can view the source code in your browser directly.

To check the syntax of your HTML / CSS or JS files we recommend using online validators / tools such as the following to look for potential issues:

  • HTML: https://validator.w3.org/
  • CSS: http://jigsaw.w3.org/css-validator/
  • JavaScript: http://www.javascriptlint.com/online_lint.php

If you see that minification still isn’t taking effect after checking these steps, please contact Cloudflare Support. You should include the URLs of the resources that you are seeing issues with.

Note: CSS & JS minification will operate on cached CSS and JS files only. Once Cloudflare returns a cache HIT for the file it will be return to browsers in minify form. This allows us to deliver a more complete minification result. If you need to enable or disable minification for CSS & JS you will now need to purge your Cloudflare cache to see the effect of any minification setting change.

Was this article helpful?
Dislike 0
Views: 62