Auto Minify is not working
Once enabled, Cloudflare’s Auto Minify will minify your HTML and your cached CSS and 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:
- Cloudflare only minifies files served by hostnames with (code on third-party domains not using Cloudflare will not be minified).
- For CSS and JS files, only a cache
HITwill be minified (refer to to check an individual file’s cache status). This also means that you need to if you enable or disable minification for CSS and JS files.
- The feature will deliberately skip minification for JS and CSS files with
.minin the name.
- If your code has fatal syntax errors, Auto Minify may not be able to successfully minify the code. Use to confirm this.
- Cloudflare does not minify inline JS/CSS inside your HTML.
- Cloudflare does not remove HTML comments by default. However, HTML Minification does remove comments like
<!-- This is a comment —>. As a result, any tool or program relying on HTML comment might not work as expected. That is the case, for example, with the . In this case, the Auto Minify feature needs to be disabled for the HTML.
To check the syntax of your HTML / CSS or JS files we recommend using online validators and tools such as the following to look for potential issues: