Que status HTTP devo retornar durante a indisponibilidade / interrupção temporária do site?

12

Vou baixar meu site para uma atualização do código. Gostaria de ter uma exibição temporária de página de inatividade durante a atualização. Para evitar problemas com bots tentando spider meu site durante o tempo de inatividade, que resposta HTTP devo ter certeza de retornar durante esta janela?

    
por Matt Huggins 28.10.2009 / 00:39

1 resposta

13

De acordo com a RFC, a resposta correta para o retorno é 503 - Serviço indisponível

10.5.4 503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

  Note: The existence of the 503 status code does not imply that a
  server must use it when becoming overloaded. Some servers may wish
  to simply refuse the connection.
    
por 28.10.2009 / 00:53