简体   繁体   English

IIS Precache应用程序池事件

[英]IIS Precache App Pool Events

We have a pretty large asp.net LOB web application. 我们有一个非常大的asp.net LOB Web应用程序。 The problem is that every time the app pool is started (whether its the first time, or if the app pool is recycled) it's takes up to 10 seconds or more to spin up and hit the first page. 问题是,每次启动应用程序池时(无论是第一次,还是应用程序池都被回收),启动并点击第一页需要10秒或更长时间。 This leaves you in a state of looking at a white page and a loading spinner until IIS is ready to serve up the page. 这使您处于查看白页和加载微调器的状态,直到IIS准备好提供页面为止。 This isnt the end of the world because it's only normally a one off thing and only the first person experiences this. 这不是世界末日,因为它通常只是一次性的东西,只有第一个人经历过这一点。 I'm just wondering if there is an event that we can hook into to serve up a page and show the user some type of simple splash screen to give them some type of feedback instead of a loading state. 我只是想知道是否有一个事件我们可以挂钩来提供一个页面并向用户显示某种类型的简单启动画面,以给他们一些类型的反馈而不是加载状态。

Has anybody got any ideas on how to hook this into IIS/asp.net? 有没有人有任何关于如何将其挂钩到IIS / asp.net的想法?

You can use the application initialization module. 您可以使用应用程序初始化模块。 If you run IIS 8.0 or higher it is built-in, if you run IIS 7.5 you can download and install it. 如果运行IIS 8.0或更高版本,则它是内置的,如果运行IIS 7.5,则可以下载并安装它。

Hopefully you are running .NET 4.5. 希望您运行的是.NET 4.5。 Set the application start mode to AlwaysRunning. 将应用程序启动模式设置为AlwaysRunning。 Then enable preload. 然后启用预加载。

And then here you will want to add this to your web.config in your system.WebServer section 然后在这里你需要将它添加到system.WebServer部分的web.config中

<applicationInitialization remapManagedRequestsTo="Startup.htm" skipManagedModules="true" >
    <add initializationPage="/default.aspx" />
</applicationInitialization>

The startup.htm is your default loading screen. startup.htm是您的默认加载屏幕。 If anyone tries to access it when they go to the web application it will be remapped to that. 如果有人在访问Web应用程序时尝试访问它,它将被重新映射到该应用程序。 Just add a simple JavaScript refresh location script to it. 只需添加一个简单的JavaScript刷新位置脚本即可。

This link should give you everything you need. 此链接应该为您提供所需的一切。 Again, I am assuming you are on a newer version of ASP.NET and IIS. 再说一次,我假设您使用的是较新版本的ASP.NET和IIS。

http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization

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

相关问题 使用 Workbox 预缓存 Firebase JS 文件 - 被 CORS 阻止 - Precache Firebase JS files with Workbox - blocked by CORS 在IIS中的Web应用程序中交换端口号 - Swapping Port numbers out of a web app in IIS Angle-Bootstrap Admin App + AngularJS在IIS中不起作用 - Angle - Bootstrap Admin App + AngularJS not working in IIS 应用浏览器中的 Instagram 正在转移所有点击事件 - Instagram in app browser is shifting all click events 与IIS 7和Cassini相比,将Web应用程序托管在IIS 6上时IE的行为有所不同 - IE is behaving differently when the web app is hosted on IIS 6, compared to IIS 7 & Cassini 如何在 Android/iOS 上的 webview/移动浏览器中最好地预缓存视频? - How to best precache videos in webview/mobile browser on Android/iOS? Chrome应用在Webview的按钮/输入上添加点击事件 - Chrome App add click events on button/input inside the Webview 如何在 html 链接元素中为在 Z5DA5ACF461B65EFB7E7Z6EC211 上运行的 web 应用程序创建相对 Url? - How can I create a relative Url in a html link element for a web app running on IIS? 使用imap_fetchbody的php在iis上我的应用程序无法获取html - php using imap_fetchbody my app on iis does not fetch html HTML输入类型=文件多个-将应用发布到IIS时,一次只能选择一个文件 - HTML input type=file multiple - When publish app to IIS, only one file can be selected at a time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM