Discussion\n\nTesting normal networks (aka, not the US)\n\n\n62.5% of the world\u2019s 3.2 Billion internet users have 2G connections (or worse). That number is growing. LTE speeds aren\u2019t going to catch up for at least a decade if not much longer.\nWhen building robust networking between your client apps and your services, the common case should be the default case. AKA: not WiFi and not LTE.\nThings that help a great deal:\n\n\nTest on 2G and flaky networks\n\n\nHelps to do real world testing in parking garages, elevators and in transit.\nSimulation will be the highest reproducible ROI way to test\n\n\nFail fast and accurately. Timeouts play a part in this.\nBe dynamic with how you handle the network.\n\n\nSlower speeds should have less networking\n\n\nUse modern tech, like HTTP/2\nDefer, defer, defer (and prioritize)\nRobustly handle errors\n\n\nIf at first you don\u2019t succeed, try again! And again and again. Retry policies can get you from one-9 of success to three-9s very simply.\n\n\nDesign your network API in a robust manner!\n\n\nSimulating bad connections:\n\n\nUsing Network Link Conditioner - iOS and Mac\nSimulation over WiFi with router firmware\nSimulation by throttling via your network services with custom headers\nSimulation in your app by controlling the flow of data being received\n\n\nExpert mode: drop down to the TCP level!\n\n\n\n\nTimeouts\n\n\nList of timeouts:\n\n\nTCP: connection timeout (TLS connection timeout too), SYN timeout, keepalive/idle timeout, retransmission timeout\nNSURL: request timeout (max time between data being received in response - default is 60 seconds), resource timeout (time for entire transfer to complete - default is 7 days)\nCustom timeouts: transaction timeouts (time from initiation to completion including redirects and retries), queue timeout (how long can the request be queued without starting before it times), idle timeout (how long can a request do nothing regarding upload or download before timeout)\n\n\nNSURLSession has a problem with scale. Every different configuration setting requires another NSURLSession to be maintained and managed. Timeouts, different default headers, different TLS settings, different cookie settings, different NSURLCache, cellular vs non-cellular\n\n\nRobust API design\n\n\nTransactional APIs\nRobust error codes (not just HTTP status codes!)\n\n\nRetry policies to the rescue\n\n\n\nPicks\n\nDarryl\n\n\nPain Free Constraints with Layout Anchors - A bit of follow-up from last week\u2019s episode. I felt like John and I were having trouble explaining anchors, and I remembered this article from a few weeks back.\n\n\n\nNolan\n\n\nPerformance Culture\n\n\n\nAlternative show title suggestions\n\n\nJust remember: You\u2019re wrong\nNot all requests are made equal\nItem potency