Topics


Blogs


Forums


Samples


Media


Labs


Resources

 




DevCentral > Weblogs > Lori MacVittie - Two Different Socks
 If Your Users See an HTTP Error Code You’re Doing It Wrong
posted on Thursday, September 03, 2009 2:52 AM

There is no reason in a modern web application for users to see a white error page

Sightings of the Twitter “fail whale” are, these days, fewer and far between. That’s a good thing. What’s interesting is that when it does show up, users are almost amused – as if they’re glad to see an old friend. I mean, come on; Twitter’s users named the whale, for crying out loud. How many of your users have a fan club for your error pages?

Exactly. That’s the kind of reaction you want from HTTP errors but what you usually get are surly, angst-filled, viral #fail messages that rapidly traverse the Interweb and imagemake you look, well, like a throwback to 1994. There is absolutely no reason at all for users to see a page served from your site that contains any HTTP status code – good or bad. None. If you’re serving them up then you need to go directly to jail. Do not pass go. Do not collect $200.

This is especially important in environments in which server errors return additional information such as stack traces and other site-specific information that can provide the means by which miscreants can use and abuse your application to gain access or further corrupt content.

Even if you have thousands of servers, the core Apache or IIS/ASP.NET configuration files are likely duplicated – meaning you should be able to easily modify the original and push out the new one. Voila. Default error pages gone, imagehopefully happier users (or at least amused, if you’re lucky).

If your servers are deployed behind an application delivery controller or even the most rudimentary of load balancers these days, you can easily ensure the same thing with the same alacrity. A change in the configuration, a few lines of scripting, and your entire site will never show another HTTP status code to a user. The advantage to using the application delivery controller or load balancer is that no matter what the status of the server you can still deliver the page because the page can actually be constructed and stored on the device. That means if there’s a network issue or the server itself is completely unreachable that you aren’t delivering a white page to the user. Ever.

In the most extreme cases, an application delivery controller enabled with the right web acceleration solution can actually stand in for the server; that means it continues to deliver pages, albeit cached ones, until the site returns to normal.

Find something amusing or some entertaining way of apologizing to the users while being informative about the status of your application or site. Give them something to laugh (or at least chuckle) at when your site is having problems and instead of frustration accompanying the “X is down” messages flying across Facebook or Twitter or e-mail, you may find amusement and delight, instead.

Follow me on Twitter View Lori's profile on SlideShare friendfeedicon_facebook AddThis Feed Button Bookmark and Share

Related blogs & articles:



 
      

Feedback


9/3/2009 4:52 AM
Gravatar There is no reason to not attach a error code to the custom page you want to send back. For instance, 404 codes must always be attached, otherwise a search engine might follow broken links and index not existent pages...
Giorgio Sironi

9/3/2009 5:25 AM
Gravatar Well, sure, attaching the error code is fine and even useful as you point out. It's the default white page that's really the problem. The users shouldn't see that and if the only thing you're returning is the error code - which is meaningless to most users - that's just bad design.

Lori
Lori MacVittie

9/3/2009 7:19 AM
Gravatar When my clients are about to see a 500 or 404 error I simply direct them over to a flash game called Bejeweled 2.
Chetan Bhatt

9/3/2009 8:54 AM
Gravatar Bah. All my web pages say "200 OK" right at the top where the users can easily see. Otherwise, how do they know it was ok? ;-)
Karl Bielefeldt

9/3/2009 9:23 AM
Gravatar @Karl

LOL. You win teh Internets today. :-)

Lori
Lori MacVittie

9/3/2009 9:55 AM
Gravatar Here is the first iRule I always deploy on my production servers:

when HTTP_RESPONSE {
if { [HTTP::status] != 200 } {
HTTP::redirect "simplythebest.net/.../doh.mp3";
}
}

-Joe
Joe

9/3/2009 1:50 PM
Gravatar I was more partial
to the following:
when HTTP_RESPONSE {
if { [HTTP::status] != 200} {
HTTP::redirect "http://gutterbunny.com/";
}
}
Chetan Bhatt

9/3/2009 2:00 PM
Gravatar The most awesome 404 page is the following

http://www.bluedaniel.com/404.shtml
Chetan Bhatt

10/2/2009 6:33 AM
Gravatar #.think.in infoDose #42 (3rd September - 10th September)
#.think.in
 Leave Feedback
Title  
Name  
Email
Url
Comments   
Please add 1 and 5 and type the answer here: