Description
Summary
The API should communicate when the ratelimit quota resets.
Issue
Currently the API only returns X-RateLimit-Limit
and X-RateLimit-Remaining
headers. This isn't quite enough to implement a robust, limit respecting API client. You can observe that the limit runs out but then what? How long to wait until continuing?
A client with side sliding window limit still sometimes hits 429
, even when you leave a couple seconds leeway.
Solutions
X-RateLimit-Reset header
The commonly used X-RateLimit-Reset
tells how long till the quota resets. Perhaps there's already support for this in the framework?
RateLimit header
This is the modern solution described in this internet draft. The idea is pack all of the info into one header in a standardized format. It supports more complex ratelimit algorithms as well.
(The spec also includes RateLimit-Policy
header.)