How do I minify HTML, CSS and JavaScript to optimize my site?

Cloudflare users interested in minifying HTML, CSS and JavaScript can activate Auto Minify in their Cloudflare settings. Auto Minify will remove all unnecessary characters from HTML, JavaScript, and CSS files.

CSS & 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 & JS you will now need to purge your Cloudflare cache to see the effect of any minification change.

The Auto Minify option can be found under the 'Speed' Section:

If you encounter any issues with Minification, check out our article that explains why Minification may not be working.

Still not finding what you need?

The Cloudflare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk