How to improve startup performance on IIS / ASP.Net

前端 未结 5 1257
灰色年华
灰色年华 2021-01-05 08:20

I am using a particularly slow virtual web host (name withheld!) where disk performance can be very bad. Thus, the first hit to my ASP.Net web sites can take 1+ minutes to l

5条回答
  •  天命终不由人
    2021-01-05 08:37

    If your provider can have a way for you to hook into when they are restarting the web server, you can have a batch file / script file hitting your website after the the web server restart. You'll only need to hit unique ASP.NET assembly files to get that particular assembly into memory. So if you have 1 assembly containing 10 pages, just hit one of the pages. It should be enough. If you have more than 1 assembly, hit 1 page in each assembly to load those assemblies into memory.

    If you can't have it at your provider, then you have to think of a smarter way to do this on your own (i.e. learn when the provider is resetting the web server and schedule task in your machine to hit those pages yourself).

提交回复
热议问题