HTTP 429 Too Many Requests vs 522 Connection Timed Out
HTTP 429 (Too Many Requests) is a 4xx Client Error response, while 522 (Connection Timed Out) is a 5xx Server Error response. 429 indicates that the user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header. In contrast, 522 means that cloudflare-specific. TCP connection to the origin server timed out.
Description
The user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header.
When You See It
When hitting API rate limits or making too many requests too quickly.
How to Fix
Check the Retry-After header. Implement exponential backoff. Consider caching responses.
Description
Cloudflare-specific. TCP connection to the origin server timed out.
When You See It
When the origin server is overloaded or network issues prevent connection.
How to Fix
Check origin server health. Verify firewall rules. Check for network congestion.
Key Differences
429 is a 4xx Client Error response, while 522 is a 5xx Server Error response.
HTTP 429: The user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header.
HTTP 522: Cloudflare-specific. TCP connection to the origin server timed out.
You encounter 429 when when hitting API rate limits or making too many requests too quickly.
You encounter 522 when when the origin server is overloaded or network issues prevent connection.
When to Use Which
For 429 (Too Many Requests): Check the Retry-After header. Implement exponential backoff. Consider caching responses. For 522 (Connection Timed Out): Check origin server health. Verify firewall rules. Check for network congestion.