19

These are both timeout errors, but who is timing out in a 408 vs. a 504?

From w3, 408 is defined as:

The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.

...And 504 is:

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.

So who is the 'client' in the 408 if not an intermediary server? If it's an actual end user, how does a server know to wait for their request before they have made it?

alksdjg
  • 1,019
  • 2
  • 10
  • 26
  • You're looking at a very outdated spec; it has been replaced by RFCs 7230...5. – Julian Reschke Apr 04 '16 at 09:22
  • @JulianReschke I can't find any mention of 408 or 504 in here: https://tools.ietf.org/html/rfc7230 is this what you are referring to? – alksdjg Apr 05 '16 at 21:24
  • The status codes are defined in RFC 7231 (the spec has been split into multiple RFCs). – Julian Reschke Apr 06 '16 at 09:09
  • @JulianReschke great, thanks. Those new definitions do seem extremely similar to me, if you've got any thoughts on the differences between them and the old definitions I'd be interested to hear it. – alksdjg Apr 06 '16 at 23:55

2 Answers2

3

The client is the browser or client application. The server knows to wait for a request because it has accepted a connection, or already read part of the request, say a header or two.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • 3
    What http status would I receive if the server received a request but the response timed out? – Sameer Mar 15 '21 at 15:22
3

Amazon documentation tells: http://docs.aws.amazon.com/en_en/elasticloadbalancing/latest/classic/ts-elb-error-message.html#ts-elb-errorcodes-http408

Indicates that the client cancelled the request or failed to send a full request

Mozilla documentation tells: https://developer.mozilla.org/en/docs/Web/HTTP/Status/408

The HTTP 408 Request Timeout response status code means that the server would like to shut down this unused connection. It is sent on an idle connection by some servers, even without any previous request by the client

Alex F
  • 826
  • 8
  • 18