基于Web的应用程序需要很长时间才能首次加载. [英] Web based application is taking long time to load in first time.

查看:101
本文介绍了基于Web的应用程序需要很长时间才能首次加载.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生/女士,

我正在使用Visual Studio 2010框架4.0和sql Server2008.我已经使用上述技术开发了一个应用程序,该应用程序运行良好,但事实是,在首次加载时需要花费很长时间来加载该应用程序.之后,运行该应用程序将不会花费很多时间,并且运行良好,但是第一次会花费很长时间,因此,请您为我提供解决方案.

谢谢
通常,最初的缓慢原因是由于设置了appDomain,ASP.NET解析和编译ASPX页面,初始化了全局上下文,加载了静态字段. (所有的时间很麻烦).这对于任何ASP.NET网站都是很正常的.

只是检查一下,在您的web.config中启用跟踪 [诊断速度较慢的Web服务器需要第一时间字节 [^ ]

只是有所改进,您可以尝试预编译的网站: MSDN:如何:预编译ASP.NET网站项目 [ ^ ]


Dear sir/Madam,

I am using Visual studio 2010 framework 4.0 and sql server 2008. I have developed one application using above technologies, application is working fine but the thing is that it is taking long time to load the application when it loads first time. After that it will not much time for running the application and it works fine, but first time it takes long time so please I am requesting you to please give me the solution for it.

Thanks
Prabhu

解决方案

Generally, the initial slowness is because of appDomain being setup, ASP.NET parsing and compiling the ASPX pages, Global Contexts being initialized, static fields getting loaded. (All one time thingy). This is quite normal for any ASP.NET website.

Just to check, enable tracing in your web.config[^] to track amount of time taken for steps to load the page, go through the log to see what could be the issue.

Lastly, go through this exercise and see where is the bottleneck: Diagnosing Slow Web Servers with Time to First Byte[^]

Just to improve a little, you can try precompiled website: MSDN: How to: Precompile ASP.NET Web Site Projects[^]


这篇关于基于Web的应用程序需要很长时间才能首次加载.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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