After building an MVC web application, I'm used to experiencing a slow load time for the very first web page that's accessed, and I know why this happens, but I'm also noticing that the load time is slow for the initial access of every single web page.
As an example, here are the load times for my home page under various conditions. The home page does not make any database calls:
I have reproduced these same results for all web pages, not just the home page. I.e., if you replace "home page" with "about us page" and "contact page" with "faq page" the load times will be nearly exactly the same as above.
These number are for my local environment, and if I push my project to the production environment, they skyrocket, and the initial load of every page is dozens of seconds.
What's interesting is that I can only remember this starting to happen a few days ago. For the last several months, from what I can remember, the initial web site load was always slow, but after that, all pages would load very quickly on their initial load.
What is causing the slow initial load time of every page?
A large volume of unoptimized images is usually the most common reason behind website slowness. High-resolution images can consume lots of bandwidth while loading. Uploading larger sized images and then scaling them down can unnecessarily increase the size of your web page – causing your website to load slowly.
The web pages will be loading slow if there's something wrong with your network. High traffic, limited bandwidth, and data restrictions will affect the loading speed greatly. Unsatisfactory server performance and location will also slow down the loading process.
If your website is loading slow, you can speed it up by using faster hosting, page builders, plugins, and images. Configuring a caching solution and CDN should also help, plus optimizing third party scripts like Google Fonts. Finally, make sure to clean you database and use PHP 7.4.
The most common reasons your Wordpress site is slow to load are: Slow or poor quality hosting that doesn't match your level or traffic or site. No caching or caching plugins in place. You have a high traffic site but no content delivery network (CDN) to reduce the load on the hosting.
The application pool needs time to build the libraries before it can begin processing them. This can be speed up by using some kind of script. It also depends on whether you're using a website or a web application project. A website for every page the very first hit is slow and each new page hit has an extra compile time. Web application projects are precompiled should be little faster, but the libraries still need to be loaded up. The more libraries and tools you have the worse this hit tends to be.
You could also looking for IIS Auto-Start feature and setup it on your server may help speed up the process. By default Application pool gets shutdown in case of user inactivity default value of 1740 mins. You can also disable idle TimeOut by setting to 0 can help a lot.
My best bet is using Application Initialization plugin to get better performance http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With