简体   繁体   English

并非按页面构建整个Web应用程序

[英]Build whole web application not per page

I created a website on MVC C# and locally it behaves as it is expected, but once I upload it on Azure it starts loading slow (initial load), each page takes its own time. 我在MVC C#上创建了一个网站,并在本地按预期方式运行,但是一旦将其上传到Azure上,它就会开始缓慢加载(初始加载),每个页面都有自己的时间。 I've enabled the Always On feature, but it didn't do much good. 我已经启用了Always On功能,但效果不佳。 Now the question is if there is a way to force on access the whole web application to be build instead of the Page by page mode that is currently active. 现在的问题是,是否有一种方法可以强制访问要构建的整个Web应用程序,而不是当前处于活动状态的分页模式。

If you mean the initial request takes long and then any subsequent requests are fast, then that would be because you are hitting .NET apps cold start. 如果您表示最初的请求要花很长时间,然后所有后续请求很快,那可能是因为您遇到了.NET应用程序的冷启动。 Many .NET apps are slow to JIT and load all their .NET requirements, but once everything is loaded, they are fast. 许多.NET应用程序的JIT和加载所有.NET要求的速度都很慢,但是一旦加载了所有内容,它们就会很快。

As scheien said, please choose the closest region when choose app service plan. 如scheien所说,请在选择应用服务计划时选择最近的地区。

If pages still loading slow. 如果页面仍然加载缓慢。 I would suggest you use Windows Internet Explorer Developer Tools Network Capture to find out detailed issue: https://msdn.microsoft.com/en-us/library/gg130952(v=vs.85).aspx . 我建议您使用Windows Internet Explorer开发人员工具网络捕获来查找详细问题: https : //msdn.microsoft.com/zh-cn/library/gg130952(v=vs.85).aspx If it related with your application, please optimize the code. 如果它与您的应用程序相关,请优化代码。

Regards 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM