What is HTTP 504 Gateway Timeout?
HTTP 504 Gateway Timeout occurs when a server acting as a gateway or proxy fails to receive a timely response from an upstream server it needs to access in order to complete the request. In scraping pipelines, this usually means the target's backend database is buckling under load, or an anti-bot tarpit is intentionally holding the connection open until the load balancer drops it. Misinterpreting a 504 as a simple network blip leads to aggressive retries that trigger permanent IP bans.