December 27, 2007
Posted in: by seiz | Comments (0)
December 17, 2007
Twitter Maintenance page done right

twittermaintenance.gifOnce again, Twitter.com is in maintenance-mode. Hopefully -- as usually -- for the win.

There's one thing i realized which really puzzles me. It is the way, they serve their temporary maintenance page (pictured in parts in the screenshot to the left).

This time (i haven't checked this during any of their downtimes before), they publish their temporary page in an extremely stupid way:
Twitter is serving a 404 status for every URL on twitter.com. The page you see during maintenance is a customized 404 "Not Found" error page. The 404 HTTP status means, that the url you tried to access doesn't exist and you should never use this url again, as it is bogus. This is not very clever. Now you can argue how important a proper google-index for twitter.com is, but even if you'd not care about google (and any other search engine) throwing every twitter-page out of it's index due to the 404 the crawler gets with every request, it still is wrong. HTTP statuses are there for a reason and serving a 404 during maintenance is not what the 404 status was meant to be used for.

The proper way to handle this would be to do a temporary redirect by serving a 307 or, even better, simply serve the maintenance page with a 503 status, which is the perfect fit for a maintenance. HTTP Status 503 stands for "Service Unavailable" which is exactly what is happening during a maintenance break.

Serving a 503 would deal with search engines nicely and clients like Twitterrific could also nicely parse it and inform the user correctly. For instance hahlo.com is momentarily just serving black frames, making their users believe something is wrong with hahlo. Pockettweets on my iPhone also confuses the user as Mobile Safari is simply alerting the user about too many redirects.

Hopefully someone from twitter will read this and not make the same mistake again in the future.