PlayForm / Compress

🗜️ Compress —

Home Page:https://NPMJS.Org/@playform/compress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use minify-html

fabriziogiordano opened this issue · comments

This is not an issue but a feature request.

I manage a site in astro that builds about 65,000 html files.
I used astro-compress for a while and the compression phase time alone was about 45 minutes on a small server.

I recently switched to https://github.com/wilsonzlin/minify-html and now the compression time is 3 minutes, 1.5 orders of magnitude less time. Pretty incredible.

Is it possible to explore the opportunity to use this compress instead of html-minify-terser currently used?

Hi, I have tested it before, but got about the same build times. You can try it out at https://github.com/astro-community/astro-compress/tree/minify-html to see if you have better results. If you have used the rust library that's why you probably noticed the smaller build times.

I will try and report back the results.
I have few astro projects running astro-compress with no problem.
This new one has 65K index.html files and the rust minification is actually making a difference in terms of speed.

Yeah the rust minification is cool, there aren't many libraries that support HTML minification, but the npm package uses a binding which is slower than the cli.