We have built a Xamarin.Forms application that uses REST API calls.
The initial load of the application is fast however the first API call is slow (extra 3-4 secs comparing to the second request against the same URL).
The behavior is similar on both iOS and Andorid platforms.
Is there any option to eliminate this waiting time?
Here is a sample code we use to do the API call (by using unirest package):
HttpResponse authRes = Unirest.post(App.TenantConfig.response.idmUrl + "/api/v1/authn")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Cache-Control", "no-cache")
.header("Postman-Token", "672008d5-52f7-8997-3e04-57ac24b6dab6")
.body("{\n \"username\": \"" + Username + "\",\n \"password\": \"" + Password + "\",\n \"options\": {\n \"multiOptionalFactorEnroll\": true,\n \"warnBeforePasswordExpired\": true\n } \n}")
.asString();