Compress HTML markup for performance.
The HTML Minifier removes whitespace, comments, and optional HTML tags from HTML files to reduce their size. HTML minification is less impactful than CSS or JS minification (HTML is typically smaller) but still useful for high-traffic pages where every byte counts. Removing HTML comments is particularly useful for removing development notes before production deployment.
The impact is smaller than CSS/JS minification because gzip compression already handles repetitive HTML structure very efficiently. HTML minification provides 5–20% size reduction; gzip handles 60–80%. Both together are ideal for very high-traffic sites.
Standard minification (whitespace removal) is safe. Aggressive minification that removes optional closing tags (, ) can occasionally break rendering in edge cases. Test the output after minification.
Yes, in production. Comments add bytes and can expose implementation details to users who view source. Always remove TODO comments and code documentation from production HTML.