First request after a while always slow - ASP.NET MVC / IIS 8.5 / Windows Server 2012 R2 VPS
The problem is, you need to install the IIS feature Application Initialization
. Then it should work with your configuration.
The image is from Rick Strahl's blog:
Also remember to set:
- Start Mode to AlwaysRunning on the application pool
- Preload Enabled to True on the website level
You can set this settings without the Application Initialization Module be installed, but then they won't have any effect.
More Information here.
Related videos on Youtube
michalstanko
Passionate freelance web developer from Bratislava, Slovakia. JavaScript has been my #1 language of choice for many years. Recently I've been working mainly with Angular/TypeScript.
Updated on September 18, 2022Comments
-
michalstanko over 1 year
I'm hosting a low-traffic ASP.NET MVC 5 application on a VPS with Windows Server 2012 R2 / IIS 8.5, with 1 GB of RAM.
My problem is that the first request after some time without any requests always gets a slow response - around 1.5 seconds according to Chrome Dev Tools. Subsequent refresh requests/responses only take about 45 ms.
I already did set Start Mode to AlwaysRunning on the application pool, and Preload Enabled to True on the website level, but it had absolutely no effect. Even if there are no changes/uploads whatsoever, after some time passes, with the next request it takes 1.5 s to get a response.