Wednesday, 5 April 2017

First http request in iOS networking is slow, subsequent requests are much faster

I'm experiencing slow response times for my first http POST request to my server.

This happens both in Android and iOS networking libraries. (Volley on Android, and Alamofire in iOS).

First response is roughly 0.7s-0.9s, whereas subsequent requests are 0.2s.

I'm guessing this is due to the session being kept-alive by the server, therefore eliminating the need for establishing a new session on each request.

I figure I can make a dummy request when the app starts to start the session, but it doesn't seem very elegant.

I also control the server side (Node.js) so if any configuration needs to be done there I can also try it.



via Shahar

No comments:

Post a Comment