开发者

Compressing Web Pages Before Sending

Is it possible to compress javascript files.... or anything related to a web page before sending it to the client?

开发者_C百科i am using telerik controls, and found that their controls write a lot of extra javascript code that makes the page size huge (something around 500KB).


If you are using IIS7, it has support for compression built in. Highlight the web application folder (or even the website) in the treeview of IIS manager, in the IIS panel in the next pane select Compression, then in the right hand pane select Open Feature. You then have two checkboxes to enable compression on static and dynamic content.

Be aware though that this may not be the silver bullet - it will increase load on the server, and it will increase the load on the client as the browser as it unzips the content. 500KB is a moderate sized page, but it isn't big. Compression like this is usually only beneficial if it is the network pipe that is the problem, which it seldom is these days. Your issue may be more to do with lots of javascript running during the onload of the page - if you see a reasonable difference in speed between IE7 and IE8 this may be an indication of this problem.


You can combine and minify your *.js and *.css files with http://github.com/jetheredge/SquishIt/ But I don't know if it can help you to compress telerik's scripts.


GZIP, Minification & Packing provided you had access to the .js files. You can do this one-off or programatically before sending it to the client.

Check this out.

http://www.julienlecomte.net/blog/2007/08/13/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜