# Target timeout

A target timeout occurs when the destination does not complete the connection or send a response within the time the gateway or the client allows, and the request fails with a 504 from the gateway or a timeout exception in the client. Through residential and mobile exits, slow household or cellular links raise the chance of timeouts on heavy pages; the remedies are realistic client timeouts, one retry, and lighter requests.


## Setting client timeouts

| Exit type | Suggested connect / read timeout |
| --- | --- |
| Datacenter, ISP | 10 s / 30 s |
| Residential | 15 s / 45 s |
| Mobile | 20 s / 60 s |


## Idle connections

Gateways close connections that stay idle for a while (60 seconds at ProxShift) regardless of client timeouts. Long-polling and streaming need a keep-alive message or a fresh connection.


## How it works at ProxShift

ProxShift returns 504 target_timeout when the destination does not answer in time, closes idle connections after 60 seconds and imposes no limit on connection duration while data flows.

Source: https://proxshift.com/glossary/target-timeout
