🔌Rate Limiting
Also known as Rate Limit, Throttling, 429 Too Many Requests, Retry-After
A cap on how many calls one user can make each minute.
Think of it like
Think of it like a ride at a fair. Only so many people get on each minute, and the rest wait.
Example
Jack's script calls a weather API in a tight loop. After 60 calls in a minute, every answer is 429 until the minute is up.
Why it matters
It keeps a service fair and running. It also turns many attacks from fast to very slow.
Definition
Example code
http
HTTP/1.1 429 Too Many Requests
Retry-After: 30Common mistake
Key takeaways
- 1A cap per time. Like 100 a minute.
- 2429 past the limit. With a wait time.
- 3Fair for everyone. One client cannot hog it.