Search code examples
htmlhttphttp-headershttp-status-codes

What is the correct error code for timeout?


I am developing a website and it will display a page for 5 minutes and user will be redirected to an error page which ask them to refresh the page. What status code should I put in the error page?

I am expecting the suitable error code to be displayed in the error page.

Edit: The page is displaying sensitive information so I want to add a timeout for security purpose.


Solution

  • You can find HTTP response codes here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses

    Depending of what are doing, you might send a code 408 (request time) or 504 (gateway timeout)

    If you explain a bit more of your problem, it might be possible to give you better orientation. Regards