Digg please return semantically accurate http status code
03 Apr 2008Dear Digg,
I'm a huge fan. I check our site a few times a day. However, there is one thing that has really been bugging me. The maintenance page. Whenever you throw up that oh-so-useful page full of links to the favorite sites of your employees... you return an 200 status code.
Think of me not as a big fan, but rather an eager web-crawler from Google or some new startup. When I find my way to your page, and your error page is return a 200 Status (OK) -- I take it to mean that everything is hunky dory, and this content is really what you are all about.
Let me school you on this radical bit of information: You can return other status codes -- such as 500 -- and return a pretty html document containing all the links to your favorite sites.
Speaking of documents...
There is one document in particular I would like to refer(get it...) you to: rfc 2616. Section 10 is particularly relevant titled "Status Code definitions." The most relevant among this list are the following status code: 200, 304, and 503. I mention these because there seems to be a certain level of confusion among your engineers.
200: OK -- This is what we meant to serve out, and feel free to associate this context with our URI
304: Not Modified: A cache setting, meaning "No Update" use cached version
503: Service Unavailable: Bingo! Doesn't that sound like something we would want to return as our status when we have our maintenance page up? For extra browny points, consider sending Retry-After header with some amount of time...
Here is the output from Live HTTP headers on one of these requests.
Thanks again!
Yousef
GET / HTTP/1.1 Host: digg.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plai n;q=0.8,image/png,/;q=0.5 Accept-Language: en Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive
HTTP/1.x 200 OK Date: Mon, 31 Mar 2008 23:38:53 GMT Server: Apache Last-Modified: Mon, 31 Mar 2008 20:52:50 GMT Etag: "714c87-15e9-449c1d5b88c80" Accept-Ranges: bytes Keep-Alive: timeout=5, max=10000 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8 Cache-Control: private Content-Encoding: gzip
Content-Length: 2069
GET /img/down.png HTTP/1.1 Host: digg.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 Accept: image/png,/;q=0.5 Accept-Language: en Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://digg.com/
HTTP/1.x 200 OK Age: 2027 Date: Mon, 31 Mar 2008 23:04:19 GMT Connection: Keep-Alive Via: NS-CACHE: 100 Etag: "720139-89b-41414d62cbc00" Server: Apache Last-Modified: Thu, 18 May 2006 19:13:52 GMT Accept-Ranges: bytes Content-Length: 2203 Keep-Alive: timeout=5, max=9998
Content-Type: image/png
GET /favicon.ico HTTP/1.1 Host: digg.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 Accept: image/png,/;q=0.5 Accept-Language: en Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive
HTTP/1.x 200 OK Age: 2932 Date: Mon, 31 Mar 2008 22:49:13 GMT Connection: Keep-Alive Via: NS-CACHE: 100 Etag: "2884541-47e-418dfb6884480" Server: Apache Last-Modified: Tue, 18 Jul 2006 18:57:06 GMT Accept-Ranges: bytes Content-Length: 1150 Keep-Alive: timeout=5, max=9997 Content-Type: image/x-ico