Cloudflare Docs
Speed
Speed
Edit this page on GitHub
Set theme to dark (⇧+D)

Auto Minify

Cloudflare Auto Minifiy improves website performance by dynamically removing all unnecessary characters from HTML, CSS and JavaScript files.

HTML files are minified dynamically by removing comments and unnecessary empty lines only. It does not require files to be cached. CSS and JS minification operates on cached CSS and JS files only. Once Cloudflare returns a cache HIT for the file it will be returned to browsers in minified form. This allows us to deliver a more complete minification result. If you need to enable or disable minification for CSS and JS files, you need to purge your Cloudflare cache.


​​ Enable Auto Minify

To enable Auto Minify on your website:

  1. Log into the Cloudflare dashboard.
  2. Select your account and website.
  3. Go to Speed > Optimization > Content Optimization.
  4. For Auto Minify, select the file types to minify.