开发者

How to minify aspx pages

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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜