I'm experiencing issues building a resilient connection from my iOS app to my API in case of spotty connections. Ideally, I would like to make the connection as resilient as possible through e.g. resending requests to the API.
More specifically:
- Transport is using HTTPs
- Response is JSON based, usually only a few kB
- API is hosted on Heroku
What would be a suitable algorithmic approach to handle such a "spotty connectivity" problem? It seems that a lot of apps handle this well, e.g. voice channels on Discord or calls through WhatsApp.
I'm currently looking into:
- Cancelling and resending requests
- "Warming up" the HTTPs connection through keep-alive long polling as the initial crypto handshake seems quite heavy
- Sending multiple requests in parallel
The goal is to eliminate RTTs as much as possible. The request is small but should go through quickly because the user should not have to wait for their response.
Happy to find out how other solved this.