We have web application designed using C# MVC .net framework 4.5 and it was published in IIs. We also designed a Xamarin mobile app for the same and its API request handled in same web application through REST API.
Everything works fine except the first time login. After install the app, when user attempt to login the app at very first time it took 24 seconds to recevie the response in mobile app.
First Time Login:
Web API Time

REST API Time to recevie response

But in Web API it return the response after validation in just 2 seconds and I have tracked it by programmatically logging each stage time difference in text file.
I tried again by logout the app and and relogin. In next relogin it took 2-4 seconds to get the response.
Second Time Login:
Web API Time

REST API Time to recevie response

Any one expain why this first time delay occur in REST API. Hence the web api retrun the response in just 2-3 seconds.