views:

102

answers:

3

Hello, I am developing a web-based Pokemon Online game. Since it is online, I would like to optimize it to run as quickly possible.

I've installed Firebug and Page Speed suggests minifying my HTML output. I'm also using VS2008, ASP.NET 3.5, AJAX, and IIS 7.5; along with URL-Rewriting.

I want to minify my HTML, JavaScript, and CSS. Optimally, I'd like the minifying process to happen at compile time. I've spend hours looking online but couldn't find a decent solution, can you help me? Thank you.

A: 

Instead of minifying your .aspx files consider dynamic compression. This will send compressed data to the browser. since you are using IIS 7.5 dynamic compression comes built-in you just have to enable it.

ajay_whiz
it is enabled. but i also want to remove all white space etc. this will also benefit when even dynamic compression enabled.
PokemonCraft
as @Kragen points out minifying HTML wont do much good. Instead you should consider optimizing markup being rendered by aspx page i.e. use `viewstate` only if necessary. avoid long names/ids for your server controls etc.
ajay_whiz
A: 

There are a couple of methods to achieve this. You can configure GZip compression with IIS7 if you have access. If you don't i.e. you are using a hosting provider it is possible to activate compression from within your code.

See this SO Post for further reading.

UPDATE:

To perform this at build time rather than run time see this blog post.

BradB
they are already enabled both static and dnyamic compresssion
PokemonCraft
I've updated my original answer. If you are using compression anyway doing the above will offer little additional benefit for download times.
BradB
yes it will benefit a little but a little bit is also something
PokemonCraft
Not at the expensive of micro-optimisation. You could spend a lot of time integrating this into the build process for only a slight gain on top of Gzip compression. That time could be better spent on your game app and new features.
BradB
+5  A: 

Firstly, you should read the Yahoo best practices for speeding up webpages.

You will probably find that minifying the HTML won't have much difference (also see this question), but a lot of the other suggestions in that article will.

Kragen
I second this, and try the YSlow Firefox plugin: https://addons.mozilla.org/en-US/firefox/addon/5369/ that check your site for these best practices on the fly.
Andreas Paulsson