504 Gateway Timeout

All status codes
5xx · Server errorretryable

504Gateway Timeout

The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

What this code obliges you to do

Retry

Safe to retry

Repeating the same request can succeed, so a client may back off and try again. Honour Retry-After when the response sends one.

Caching

Not cacheable by default

Caches will not store this response unless you send explicit freshness headers saying they may.

Response body

Body allowed

You may return a payload explaining the outcome — for an error, a machine-readable problem document is worth the effort.

What usually causes it

2
1

Long-running database query blocking worker threads

2

Upstream 3rd party API freezing

Effect on search

Negative. Indicates application is far too slow, significantly harming Crawl Budgets.

How to send it

1
AWS
// Typically seen in AWS API Gateway when Lambda exceeds 30s timeout

Codes people confuse with this one

2
Class5xx
RetrySafe
CacheNo
BodyAllowed