I was having issues with WCF and slow startup times, so i switched all of my code to use WebAPI. While the startup time has reduced massively (~8-15 seconds down to ~2) I still have an odd latency on startup. Currently its about ~2 seconds but subsequent calls are under 0.5 seconds consistently, until a timeout occurs.
I reviewed all of my ApplicationPool settings to ensure there wasn't any startup delays or idle timeout settings.
I found this link Very slow first call to web service which didn't help me - i still get the same speed issue on a cold start. Also found this one First call to web service each day is slow again doesn't seem to apply to me.
I enabled tracing on my WebAPI service and found that the only difference between my first and second call are two lines showing WebHostHttpControllerTypeResolver.GetControllerTypes
. I can't seem to find too much about this but it is the only difference i can see.
Is there any other sort of logging that i could use to determine what is actually going on?