Reputation: 21005
When updating my website, I shift the server into "update" mode. Any requests for the main domain (example.com), result in a static page saying the site is being updated. But how does one respond to other requests, such as images, form submissions etc, which are normally valid, but are in the process of being updated ?
Which HTTP code should be returned so the client knows that the request is temporarily unavailable ?
4XX is not suitable, because it is not a user error. 5XX seems unsuitable, because there isn't an internal error. It is intentionally not serving any requests except for displaying a maintenance page
3XX seems unsuitable because the files (images, pages etc), are not moving anywhere. They are just temporarily inaccessible.
Perhaps to better understand what I'm saying, if you've ever visited the apple website during a Keynote, they take it offline for maintenance and display a yellow "sticky" image saying they will be back soon.
EDIT: For the main page I don't want to return a 503, because it won't display in the browser. But for other assets that are being updated it makes sense.
Upvotes: 0
Views: 62
Reputation: 262494
HTTP Error 503 - Service unavailable
The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.
Upvotes: 1