HTML Minifier Next: JSON Schema, Cache Statistics, Default Config File
Published on Jul聽20, 2026, filed under tools, development, html, performance, optimization. (Share this post, e.g., on Mastodon.)
HTML Minifier Next (HMN), the official successor to HTML Minifier (and competitive web page minifier), received a number of updates since switching to ESM-only with version 7. Here are three that may be of particular interest:
JSON Schema
HMN now ships a JSON Schema for its configuration files. Referencing it via $schema in your html-minifier-next.config.json gives you editor validation, autocomplete, and inline documentation for every option鈥攕o you can write config files without switching back and forth to the HMN README.
Cache Statistics
If you want to tweak HMN鈥檚 CSS, JavaScript, or SVG minification caches, --verbose and --dry now print a one-line-per-cache summary at the end of a run, e.g.:
Cache stats:
CSS cache: 812 hits, 34 misses, 46/500 entries
JS cache: 120 hits, 118 misses, 118/500 entriesThis lets you see at a glance whether caching is actually paying off for your build, without adding any instrumentation yourself. A high hit rate (like the CSS cache above) confirms the cache is doing its job鈥攊f a cache is near 1:1 hits-to-misses instead, your inline blocks are mostly unique and caching isn鈥檛 helping much, and if entries sits at the limit, raising cacheCSS/cacheJS/cacheSVG may recover more hits.
Default Config File
You no longer need to pass --config-file explicitly: if an html-minifier-next.config.json (or htmlminifier.config.json) file sits in your working directory, HMN picks it up automatically, reporting which file it used on STDERR. This allows you to keep a project-local config file and a shorter CLI invocation鈥攁n explicit --config-file still overrides it when you need that.
_ On top of this, HMN ships with additional fixes, security improvements, and performance optimizations, all of which are detailed in the changelog.
As always, if you run into an issue or have a suggestion, please file an issue, and if you or your organization get a lot of value of this work on HTML Minifier Next, please support the project financially. Thank you!
About Me
I鈥檓 Jens (long: Jens Oliver Meiert), and I鈥檓 an engineering lead, guerrilla philosopher, and indie publisher. I鈥檝e worked as a technical lead and engineering manager at various companies (e.g., Google); I鈥檓 an active web and tool developer (code optimization, digital defense), a contributor to web standards (like HTML, CSS, WCAG), and a book author (O鈥橰eilly, Frontend Dogma).
I love trying things鈥攊n web development and engineering management, but also in politics and philosophy, where I hold to one idea in particular: that we can only be well if we take good care of everyone. Here on meiert.com I talk about some of my perspectives and experiences. (Please share feedback: Interpret charitably, keep it friendly, but do be critical.)
