developer.chrome.com icon indicating copy to clipboard operation
developer.chrome.com copied to clipboard

Switch to a Rust-based HTML & inline CSS/JS minifier

Open jeffposnick opened this issue 2 years ago • 3 comments

Switching away from html-minifier and csso in favor of @minify-html/js leads to production builds that are around 33% faster on my M1 Macbook.

I'm not sure what the corresponding speedup will be in the production deployment, but if web.dev was any indication, it should be meaningfully faster.

That being said, we have run into a number of issues with this HTML minifier when used on web.dev because it treats invalid HTML differently than html-minifier did. We need to keep an eye out for any reports of issues with HTML rendering on the production site following this deployment.

jeffposnick avatar Apr 08 '22 17:04 jeffposnick

Deploy Preview for developer-chrome-com ready!

Name Link
Latest commit 847260d162f0d366d5b25206e6aa00edb9a048f5
Latest deploy log https://app.netlify.com/sites/developer-chrome-com/deploys/6266e20ad936a600082bc4cc
Deploy Preview https://deploy-preview-2555--developer-chrome-com.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Apr 08 '22 17:04 netlify[bot]

I'm going to do a one-off run of an HTML analyzer on the minifier output before we merge this, just to get a gauge for how broken things might be.

jeffposnick avatar Jun 15 '22 16:06 jeffposnick

Actually, this is using an older version of the HTML minifier. See https://github.com/GoogleChrome/web.dev/issues/8381

jeffposnick avatar Jul 20 '22 20:07 jeffposnick

Since the API of @minify-html/node changed quite a bit since this implementation, closing this and tracking further in #4048.

matthiasrohmer avatar Oct 19 '22 09:10 matthiasrohmer