HTML minification middleware is a process of removing unnecessary or redundant data from HTML without affecting how the resource is processed by the browser. This can include removing code comments and formatting, removing unused code, using shorter variable and function names, and so on. Minifying HTML can help reduce the size of web pages, resulting in faster page load times and improved user experience.
Remove All whiteSpace from rendered html
New update: Fixed Image 500 error.
in Startup.cs Or Program.cs
app.UseHtmlMinification(); // <-- call it before StaticFiles middleware
app.UseStaticFiles();