当PHP发送408标头时,Firefox不会显示页面

There are some times when I'd like my site to trigger a 408-response (for when various pieces aren't responsive). (PHP 5.3.3 and Apache, both Windows and Linux machines)

I can use the following code and get the expected result in all browsers except Firefox:

<?php
// Access forbidden:
header('HTTP/1.1 408 Request Timeout',true,408);
echo 'hi';exit;

But Firefox just immediately sends the "The connection was reset" page, and Firebug shows it got the 408 message. Is this by design in Firefox, or is there some way around this?

The 408 response is the server telling the client that the client didn't send all the details for a request within the time that the server was willing to wait, and that the server has forcefully closed the connection.

So, yes, this is by design in Firefox.

Edit: Consider using the 503 Service Unavailable temporary error code instead, possibly with a Retry-After header. I've never tested to see if the Retry-After works.