ASP.NET:如何更快的加载页面 [英] ASP.NET: how to load page faster
本文介绍了ASP.NET:如何更快的加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们写了门户网站与ASP.NET。但它有很多的Javascript和我们的页面加载缓慢。
在某些页面,页面大小是多少1.5 MB!
什么是减少或COM preSS页面大小,使其更快的最佳方式?
谢谢
We wrote Portal with ASP.NET. But it has many Javascripts and our pages loading slow. In some page , page size is amount 1.5 mb! What is the best way to reduce or compress page size to make it faster? Thanks
推荐答案
几件事情:
- 最小化您的JavaScript和CSS文件。 谷歌有JS一个很好的极小。
- 缓存图片,js文件和css文件。如何从IIS,<一个做到这一点的信息href=\"http://stackoverflow.com/questions/7541032/caching-specific-javascript-and-css-files/7542816#7542816\">here.
- 禁用ViewState的
如果你能
或者至少使其只在需要的控件。 - 在IIS中使用COM pression
- 使用内容分发网络(CDN)来提供JavaScript库,如jQuery的,等等。
- 优化图像 Smush.it
- 将JavaScript的code。在页面的底部,这样的页面渲染开始更快
- 如果您使用JSON的UI和后端之间的数据交换,请确保您的COM preSS这一点。
- 使用雪碧我创建精灵为你的图像图标,背景等。
使用
- Minimize your javascript and CSS files. Google has a nice minimizer for JS.
- Cache images, js files and css files. Info on how to do this from IIS, here.
- Disable ViewState
if you can
or at least enable it only on the controls that need it. - Use compression on IIS
- Use a content delivery network (CDN) to deliver javascript libraries such as jQuery, etc.
- Optimize your images using Smush.it
- Put javascript code at the bottom of the page so that the page starts rendering faster
- If you use JSON for data interchange between the UI and the backend, make sure you compress it, too.
- Use sprite me to create sprites for your image icons, backgrounds, etc.
这篇关于ASP.NET:如何更快的加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文