Joey Hess (joeyh) has been writing about this for a long time (because he uses dial-up at his home). Here is a recent thread about a 2016 blog post on this:
I'd say that blanket advice to retry is not terrible but not great either. First ask, is the ajax call important enough to warrent a retry at all, if it is, did the response give any useful information about why there was a failure? If yes, did it tell you that something was wrong with the request? Then don't retry as it's not going to work the second time, or third time either. Did the request timeout? Again, think about whether the request is important enough to hit a potentially already overloaded server.
Also, as a side note, any page that becomes unusable because an ajax request failed to return has some really broken design. Ajax retries are not a solution for that, go fix the design instead.
1. There is extra connection information, or information can be sampled. E.g. query to see if anything is responding.
2. Our user just wants to get action ASAP. Not necessary to be a good citizen, our user just wants it to work.
3. Heuristics depend on what works in practice. HTTP/S is a comp layered protocol so it is hard to know what is right.
4. Connection conditions are extremely varied, mobile connection type, overseas location, ISP, IPv6, proxies, VPNs, etc all affect the connection parameters so finding a reasonable heuristic is hard.
5. Sampling connection information is difficult, because when it fails you also fall to log it.
https://news.ycombinator.com/item?id=13397282