title: Making spotty connection phone to API more resilient
body: <p>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.</p>
  
  <p>More specifically:</p>
  
  <ul>
  <li>Transport is using HTTPs</li>
  <li>Response is JSON based, usually only a few kB</li>
  <li>API is hosted on Heroku</li>
  </ul>
  
  <p>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.</p>
  
  <p>I'm currently looking into:</p>
  
  <ul>
  <li>Cancelling and resending requests</li>
  <li>"Warming up" the HTTPs connection through keep-alive long polling as the initial crypto handshake seems quite heavy</li>
  <li>Sending multiple requests in parallel</li>
  </ul>
  
  <p>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.</p>
  
  <p>Happy to find out how other solved this.</p>