Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minify Html output of ASP.NET Application

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 output with white spaces. I am interested in Minifying the entire HTML output of the page just like how google does (View source www.google.com) to improve the timing.

Is there any Utility classes available for ASP.NET which can do this stuff for me?

like image 800
Ramesh Avatar asked Oct 31 '08 21:10

Ramesh


People also ask

How do I minify PHP HTML output?

Use the ob_start() Function With a Callback to Minify HTML Output of the PHP Page. You can use the ob_start() function with a callback to remove whitespaces before and after the tags, comments, and whitespace sequences.

Is it worth to Minify HTML?

Since any minification takes server resources, it's worth minimizing only those assets which are relatively unchanging like CSS and JS. HTML changes too frequently to be worth it IMHO.


1 Answers

There is no need to do it at run time. Because it can be done at compile time.

Details: http://omari-o.blogspot.com/2009/09/aspnet-white-space-cleaning-with-no.html

like image 178
thorn0 Avatar answered Oct 05 '22 17:10

thorn0