Recommendation for server-side HTML minification in v11?
There are a few older packages to handle minification of HTML output in runtime (e.g. html-minifier), but they don't work with Umbraco 11. Does anyone have recommendations?
Just to expand on this for everyone.
In your Startup.CS ensure you have targets for your different environments and then encase this sort of stuff in if conditions so you development/staging environments DO NOT run it so you can debug easier.
Recommendation for server-side HTML minification in v11?
There are a few older packages to handle minification of HTML output in runtime (e.g. html-minifier), but they don't work with Umbraco 11. Does anyone have recommendations?
Hi Jakob,
A little while back I was actually doing just this for a v10 site. I ended up using:
https://github.com/Taritsyn/WebMarkupMin
Which was really easy to setup and make work. This is what I would use, and I suspect it would work with v11 as well.
Nik
I can make it works for Umbraco 10 and 11 :)
WebMarkupMin is a great tip, thank you! It works (though it as a little difficult to set it up as the documentation was lacking).
Do you have any information you can share for how to add it?
Edit: It looks like I can just follow the documentation here? https://github.com/Taritsyn/WebMarkupMin/wiki/ASP.NET-Core-6
Then for included pages just use
new WildcardUrlMatcher("*")
to match everything?Hey Chris,
I had to do the following else the Umbraco back office broke:
Thanks
Nik
Thanks that got us jumpstarted! For anyone, else we configured that in startup.cs.
Just to expand on this for everyone. In your Startup.CS ensure you have targets for your different environments and then encase this sort of stuff in if conditions so you development/staging environments DO NOT run it so you can debug easier.
True. Good point. 👌
is working on a reply...