如何优化网站的性能? [英] How to Optimize the performance of Website?

查看:67
本文介绍了如何优化网站的性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,我必须在Grid和其他控件(如LinkBut​​tons,Label等)中加载多个数据.但是网站的性能非常差.加载页面大约需要45秒.

但是在本地计算机上,它的速度相对较快,但差异不大.

请向我建议任何提高网站性能的方法(带有数据库支持).


感谢

I have a scenario where I have to load multiple data in Grid and other controls like LinkButtons, Labels, etc. But the performance of website is very poor. It takes around 45 seconds to load a page.

But on local machine it is comparatively little fast, but not much difference.

Please suggest me any methodologies to increase the performance of the website (with database support).


Thanks

推荐答案

查看您的存储过程以及数据库的配置.确保设置了索引.最后,请确保您没有返回太多记录.您尝试放入网格视图中的记录越多,花费的时间就越长.
Look at your stored procedures, and the configuration of the database. make sure your indexes are set. Lastly, make sure you''re not returning too many records. The more records you try to put into a gridview, the longer it''s going to take.


•必要时实施缓存,正确理解并使用HTTP缓存
•优化图像-不要将20 KB的图像用于重复的背景
•了解如何对内容进行gzip/压缩(压缩效果更好)
•合并/连接多个样式表或多个脚本文件,以减少浏览器连接数,并提高gzip压缩文件之间重复项的能力
•查看Yahoo Exceptional Performance网站,其中包含许多很棒的指导方针,包括改善前端性能及其YSlow工具. Google页面速​​度是性能分析的另一个工具.两者都需要安装Firebug.
•将CSS Image Sprites用于工具栏等较小的相关图像(请参见最小化http请求")
•繁忙的网站应考虑跨域拆分组件.具体来说...
•静态内容(即图像,CSS,JavaScript和通常不需要访问Cookie的内容)应放在一个不使用Cookie的单独域中,因为一个域及其子域的所有Cookie都是与每个请求一起发送到域及其子域.
•最小化浏览器呈现页面所需的HTTP请求总数.
•将Google Closure编译器用于JavaScript和其他缩小工具
•Implement caching if necessary, understand and use HTTP caching properly
•Optimize images - don''t use a 20 KB image for a repeating background
•Learn how to gzip/deflate content (deflate is better)
•Combine/concatenate multiple stylesheets or multiple script files to reduce number of browser connections and improve gzip ability to compress duplications between files
•Take a look at the Yahoo Exceptional Performance site, lots of great guidelines including improving front-end performance and their YSlow tool. Google page speed is another tool for performance profiling. Both require Firebug installed.
•Use CSS Image Sprites for small related images like toolbars (see the "minimize http requests" point)
•Busy web sites should consider splitting components across domains. Specifically...
•Static content (ie, images, CSS, JavaScript, and generally content that doesn''t need access to cookies) should go in a separate domain that does not use cookies, because all cookies for a domain and it''s subdomains are sent with every request to the domain and its subdomains.
•Minimize the total number of HTTP requests required for a browser to render the page.
•Utilize Google Closure Compiler for JavaScript and other minification tools


在CP之前已经在此处回答了类似的问题,请选中这些

优化-Web和数据库 [ ^ ]
如何解决缓慢的网页交付? [ ^ ]
Web应用程序速度的因素 [在asp.net中优化网站 [缓慢打开网页 [
Already answered similar question here before in CP, check these

Optimization - Web & Database[^]
How do I fix slow web page delivery?[^]
Factors for web application speed[^]
Optimise a website in asp.net[^]
Opening the web page slow[^]


这篇关于如何优化网站的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆