How do you scale HTTP server like Google?

google.com, update.microsoft.com, and other services which handle astonishingly high aggregate bandwidth do much of their magic via DNS. BGP Anycast routing is used to announce the IP address of their DNS servers from multiple points around the world. Each DNS server is configured to resolve google.com to IP addresses within a data center which is … Read more

Determine supported HTTP version by the web server

You could issue a: curl –head www.test.com that will print out the HTTP version in the first line of the output… e.g. HTTP/1.1 200 OK Content-Length: 28925 Content-Type: text/html Last-Modified: Fri, 26 Jun 2009 16:08:04 GMT Accept-Ranges: bytes ETag: “a41944978f6c91:0” Server: Microsoft-IIS/7.0 X-Powered-By: ASP.NET Date: Fri, 31 Jul 2009 06:13:25 GMT

Create http.Response instance with sample body string in golang

As suggested by Not_a_Golfer and JimB: io.ReadCloser is an interface that is satisfied when a struct implements both the Read and the Close functions. Fortunately, there is io.NopCloser, which takes a io.Reader and wraps it in the nopCloser struct, which implements both Read and Close. However, its Close function does nothing as implied from the … Read more

What should I pass for the WWW-Authenticate header on 401s if I’m only using OpenID?

According to RFC2617 the auth-scheme can be anything; if you really want a 401 you’re not technically breaking spec by making something up like WWW-Authenticate: OpenID realm=”My Realm” location=”http://my/login/location”. Having said that, behaviour of other people’s code when you do that is of course undefined. 🙂

Redirecting with a 201 created

I think you’re confusing two different semantic responses – one is telling the client that you successfully created a resource, and where it is. Whether the client goes to fetch it or not is a different story. The second is telling the client that it has sent the wrong location URI for a resource it’s … Read more

HTTP client timeout and server timeout

There’s many forms of timeout, are you after the connection timeout, request timeout or time to live (time before TCP connection stops). The default TimeToLive on Firefox is 115s (network.http.keep-alive.timeout) The default connection timeout on Firefox is 250s (network.http.connection-retry-timeout) The default request timeout for Firefox is 30s (network.http.pipelining.read-timeout). The time it takes to do an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)