简体   繁体   English

为asp.net(mvc)网站预热解决方案

[英]warm up solutions for asp.net (mvc) sites

I understand that the page load of asp.net (mvc 2.0ish) sites can suffer for many reasons after some idle time. 我了解到,经过一段时间的闲置时间后,asp.net(mvc 2.0ish)网站的页面加载可能会由于多种原因而受到影响。

There are some free and commercial solutions that hit such sites in time intervals to prevent this. 有一些免费的商业解决方案会按时间间隔访问此类站点,以防止出现这种情况。

Am I right in assuming that these solutions only help in speeding up the page load of the main/home page? 我是否可以假设这些解决方案仅有助于加快主页/主页的页面加载速度? If I am right are there also some solutions that crawl the dedicated site (potentially including form authenticated pages)? 如果我是对的,是否还有一些解决方案可以对专用站点进行爬网(可能包括通过表单身份验证的页面)?

Thanks. 谢谢。

PS: I use wild card mapping for my asp.net mvc apps. PS:我为asp.net mvc应用程序使用通配符映射。 My server is a ms server 2003 with IIS 6.0. 我的服务器是带有IIS 6.0的ms服务器2003。

Couple of things, 几件事,

Application Pool Recycling 应用程序池回收

In IIS there is Application Pool Recycling time according to which, App Pool is recycled after the specified time if it is idle. 在IIS中,有“应用程序池回收”时间,根据该时间,如果空闲,则在指定时间后回收应用程序池。 You can increase this time so that your App Pool is not recycled frequently. 您可以增加此时间,以便不经常回收您的应用程序池。

Custom Solution 定制解决方案

You can easily write a custom solution which can hit your app periodically. 您可以轻松编写自定义解决方案,该解决方案会定期影响您的应用程序。 For this you can use WebClient, HttpWebRequest classes. 为此,您可以使用WebClient,HttpWebRequest类。 Its very easy to do this. 这很容易做到。

Hope this helps. 希望这可以帮助。

You should consider precompiling the Views which makes a significant difference in startup time and has a similar effect to hitting every single page periodically, but without the hassle of actually doing so. 您应该考虑预编译Views ,这在启动时间上有很大的不同,并且与定期访问每个页面有相似的效果,但实际上没有麻烦。

This is easy to accomplish using David Ebbo and Pranav Krishnamoorthy's excellent Razor Generator which can be installed via NuGet . 使用David Ebbo和Pranav Krishnamoorthy出色的Razor Generator可以轻松完成此任务,可以通过NuGet进行安装。 Read a little about it here: http://blog.davidebbo.com/2011/06/precompile-your-mvc-views-using.html and here is the Codeplex homepage: http://razorgenerator.codeplex.com/documentation 在此处阅读有关此内容的一些信息: http : //blog.davidebbo.com/2011/06/precompile-your-mvc-views-using.html ,这是Codeplex主页: http ://razorgenerator.codeplex.com/documentation

Search NuGet for RazorGenerator.Mvc . NuGet中搜索RazorGenerator.Mvc

I have used this project successfully. 我已经成功使用了这个项目。 It's great! 这很棒!

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

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