Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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:

https://news.ycombinator.com/item?id=13397282



> Please, please, if your site requires AJAX to work at all, then retry failed AJAX queries.

Anyone here have information on the most reliable heuristics to do retries?

Or information on the implementations used by say Gmail or Facebook?


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.


I have seen https://www.wikiwand.com/en/Exponential_backoff used pretty regularly in many places.


I don't see how that is relevant.

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: