I'm trying to optimize API response time for my Flutter app. I have an API where I've added server level caching and I'm using Dio for my API needs.
The reponse time when tested on Postman is ~100ms. Getting similar metrics on Chrome developer tools.
The problems is when I measure the response time on Flutter DevTools, all responses are >250ms. Upon checking, I find that there's a connection wait time of ~200ms for every request.
How can I reduce the above wait time for Flutter?
I tried switching libraries and reusing the same https client as suggested here and in the docs of http but the wait time for subsequent requests remained similar.
var client = http.Client();
final res = await client.get(...);
How can I avoid these connection delays and get the optimum performance? If caching the SSL, DNS Lookup etc is the solution, how do I do that in flutter?