{"id":1611,"date":"2020-06-07T22:23:02","date_gmt":"2020-06-07T14:23:02","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=1611"},"modified":"2026-01-12T13:54:04","modified_gmt":"2026-01-12T05:54:04","slug":"how-do-i-minify-htmlcss-and-javascript-to-optimise","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/how-do-i-minify-htmlcss-and-javascript-to-optimise","title":{"rendered":"How do I minify HTML,CSS and JavaScript to optimise?"},"content":{"rendered":"<h4><strong>How do I minify HTML,CSS and JavaScript to optimise?<\/strong><\/h4>\n<p><a href=\"https:\/\/www.cloudflare.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Cloudflare<\/a> users interested in minifying HTML, CSS and JavaScript can activate Auto Minify in their Cloudflare settings. In addition, Auto Minify will remove all unnecessary characters from HTML, JavaScript, and CSS files.<\/p>\n<p>However , CSS &amp; JS minification operates on cached CSS and JS files only.\u00a0<span class=\"word\">LarMirage\u00a0<\/span><span class=\"word\">and\u00a0<\/span><span class=\"word\">Polish\u00a0<\/span><span class=\"word\">arOnce\u00a0<\/span><span class=\"word\">Cloudflare\u00a0<\/span><span class=\"word\">return\u00a0<\/span><span class=\"word\">a\u00a0<\/span><span class=\"word\">HIT\u00a0<\/span><span class=\"word\">cache\u00a0<\/span><span class=\"word\">to\u00a0<\/span><span class=\"word\">the\u00a0<\/span><span class=\"word\">minified\u00a0<\/span><span class=\"word\">browser\u00a0<\/span><span class=\"word\">directory<\/span>. This allows us to deliver a more complete minification result. After that , if you need to enable or disable minification for CSS &amp; JS you will now need to purge your Cloudflare cache to see the effect of any minification change.<\/p>\n<p>The Auto Minify option can be find under the \u2018Speed\u2019 Section:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/thedomainrobot.com\/wp-content\/uploads\/2024\/02\/Step-5-Go-to-Speed-Content-Optimization-1024x478.webp\" alt=\"speed-Auto Minify\" width=\"1024\" height=\"478\" \/><\/p>\n<p>If you encounter any issues with Minification, you can check out our article that explains <a href=\"https:\/\/www.servergigabit.com\/guide\/kb\/why-isnt-auto-minify-working\">why Minification may not be working.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do I minify HTML,CSS and JavaScript to optimise? Cloudflare users interested in minifying HTML, CSS and JavaScript can activate Auto Minify in their Cloudflare settings. In addition, Auto Minify will remove all unnecessary characters from HTML, JavaScript, and CSS files. However , CSS &amp; JS minification operates on cached CSS and JS files only.\u00a0LarMirage\u00a0and\u00a0Polish\u00a0arOnce\u00a0Cloudflare\u00a0return\u00a0a\u00a0HIT\u00a0cache\u00a0to\u00a0the\u00a0minified\u00a0browser\u00a0directory. This allows us to deliver&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[43],"kbtag":[1414,1413,1408,1412],"class_list":["post-1611","kb","type-kb","status-publish","hentry","kbtopic-cloudflare","kbtag-css","kbtag-html","kbtag-javascript","kbtag-minify"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=1611"}],"version-history":[{"count":4,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1611\/revisions"}],"predecessor-version":[{"id":6017,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1611\/revisions\/6017"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=1611"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=1611"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=1611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}