Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between HTTP 408 and 504 errors?

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?

like image 347
alksdjg Avatar asked Apr 03 '16 23:04

alksdjg


People also ask

What is a HTTP 408 error?

The HyperText Transfer Protocol (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.

What does a HTTP 504 mean?

The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.

How do I fix a 408 request timeout?

How to Fix the 408 Request Timeout Error. Retry the web page by selecting the refresh button or trying the URL from the address bar again. Many times a slow connection causes a delay that prompts the 408 Request Timeout error, and this is often only temporary. Trying the page again will typically be successful.

What error code is 504?

A 504 Gateway Timeout Error means your web server didn't receive a timely response from another server upstream when it attempted to load one of your web pages. Put simply, your web servers aren't communicating with each other fast enough.


2 Answers

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.

like image 178
user207421 Avatar answered Oct 23 '22 12:10

user207421


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

like image 28
Alex F Avatar answered Oct 23 '22 13:10

Alex F