logoalt Hacker News

sholladayyesterday at 11:49 PM1 replyview on HN

Maintainer on the Ky library team here, a popular HTTP client for JavaScript.

We support these headers, but unfortunately there’s a mess of different implementations out there. The names aren’t consistent. The number/date formats aren’t consistent. We occasionally discover new edge cases. The standard is very late to the party. Of course, better late than never. I just hope it can actually gain traction given the inertia of some incompatible implementations.

If you are designing an API, I strongly recommend using `Retry-After` for as long as you can get away with it and only implementing the rate limit headers when it really becomes necessary. Good clients will add jitter and exponential backoff to prevent the thundering herd problem.


Replies

marginalia_nutoday at 12:31 AM

Yup, seems both overengineered and undercooked both at the same time, as is unfortunately common for newer headers.

As you said, 429 + Retry-After is plenty good already.