A 504 Gateway Timeout error code when attempting to browse a website generally indicates that the server did not respond to the browser's request for information in a timely manner. When this happens, the server sends back the error to alert the user to the problem.
There are many possible reasons that a user may receive a 504 Gateway Timeout error message. The most common are that the web server is temporarily offline or there is network congestion somewhere along the path between the user's computer and the server. Often, refreshing the page results in a complete page load. If, however, a quick refresh does not work, coming back and trying again later usually does.
In some cases, the host website may simply be overloaded at the time, due either to server software issues or high usage. This is most often found in cases where the website in question is popular or currently has information that is trending, leading to a large number of users attempting to access the site at the same time and causing the server to struggle in an effort to keep up. In the end, however, the result is the same: a 504 Gateway Timeout error.