2

I have just been looking into the possibility of minimising HTML output in ASP.NET MVC.

It seems there must be a simple HttpModule or something to manipulate the rendering engine to strip out spaces and any other letters.

Anyone got any ideas?

ArtificialGold
  • 825
  • 5
  • 14
  • I don't think it's as simple as you may think, and besides, you'd save a few hundred bytes at most on every page. I don't think it's worth it. – AndrewR Jul 07 '11 at 22:12
  • [Gzipping the output](http://stackoverflow.com/questions/855526/removing-extra-whitespace-from-generated-html-in-mvc) is usually more than sufficient. But if not, that link also talks about removing extra whitespace. – Kirk Woll Jul 07 '11 at 22:16
  • I want to do both gzip and minimise. My aim is to be as fast as possible. I want to be aiming for 100/100 on yslow and this is one way of achieving it. Also would be easy to implement on any website I worked on if there was something out there. – ArtificialGold Jul 07 '11 at 22:20
  • @ArtificialGold: beyond eliminating white-space, what is there? The link I mentioned does both white-space elimination and gzip compression. – Kirk Woll Jul 07 '11 at 22:30
  • I can see how gzip is the most important. It is the first thing to do. As far as my point goes I suggest looking at the source of the google homepage. You could be stripping out comments that have been helpful in your mark-up and probably remove unnecessary mark-up. Yslow suggests I do this minimising and I have just come from a talk with Peter Lubbers who also suggested we do this. – ArtificialGold Jul 07 '11 at 23:02

0 Answers0