Minify Html output of ASP.NET Application

后端 未结 6 2082
后悔当初
后悔当初 2020-11-28 23:47

What are the ways by which we can reduce the size of the HTML Response sent by an asp.net application?

I am using Controls which are not owned by me and it produces

6条回答
  •  广开言路
    2020-11-29 00:39

    I want to comment on Thorn's suggestion (but I'm new to stack overflow).

    1. The linked code (omari-o.blogspot.com) doesn't support MVC4, and although the code is open source it cannot easily be upgraded because of braking changes between MVC3 and MVC4.

    2. There might be whitespaces written to the http result at runtime, only the developer of the actual site can know that. Thus static minification of template files (aspx) is not foolproof at all. Dynamic minification, which is suggested by gius, should be used to guarantee that whitespaces are removed correctly, and unfortunately this will incur a runtime computation cost. If code dynamically writes spaces to the output, it will have to be removed dynamically.

提交回复
热议问题