The Bandwidth Blues, Vol II
When people ask me why I don’t like Microsoft, I have a bunch of default gripes. “Their software sucks.” “They are monopolistic.” “They don’t obey standards.” Not the sort of things that get people riled up, by and large. You need to be a pretty big geek to feel deeply about something like web standards, right?
But what if, by abusing web standards, Microsoft managed to do something worse than break CSS Zen Garden? What if they caused more harm than just some incompatibility and a few broken links?
What if they cost people a whole shitload of money?
(You’ll want to read the earlier post first for some background on this.)
When last we spoke, I was concerned about a few hundred dollars in bandwidth fees. My ISP’s records indicated that I had used 33GB of traffic in May when I had been allotted 25. Grrr.
So imagine my surprise when I took a look at the bandwidth total for June and saw that it was a measly 67 gigabytes!!!
Stunned, I began to examine my logs very closely. I noticed a lot of repitition when it came to Internet Explorer:
24.210.133.251 - - [15/Jun/2004:07:40:25 -0700] "GET /song HTTP/1.1" 200 6981643 "-" "contype"
24.210.133.251 - - [15/Jun/2004:07:40:26 -0700] "GET /song HTTP/1.1" 200 6981643 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Roadrunner; .NET CLR 1.1.4322)"
24.210.133.251 - - [15/Jun/2004:07:40:33 -0700] "GET /song HTTP/1.1" 200 6981643 "-" "contype"
24.210.133.251 - - [15/Jun/2004:07:40:35 -0700] "GET /song HTTP/1.1" 200 6981643 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Roadrunner; .NET CLR 1.1.4322)"
24.210.133.251 - - [15/Jun/2004:07:40:48 -0700] "GET /song HTTP/1.1" 200 6981643 "-" "contype"
24.210.133.251 - - [15/Jun/2004:07:40:49 -0700] "GET /song HTTP/1.1" 200 6981643 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Roadrunner; .NET CLR 1.1.4322)"
Let’s ignore the fact that the Referrer is MIA. Did you notice that the User Agent is MSIE 6? See the paired GET requests, one with a legitimate User Agent and one with the User Agent of just “contype”? What the hell is contype and why is it coming in paired with legitimate requests? And why is Apache duplicating the effort and sending the file twice?
All was revealed when I found a weblog entry from 24 April 2003 on the issue. (You’ll have to search down the page a bit.) Turns out Microsoft Internet Explorer does this by design. Here are the two relevant articles in Microsoft’s Knowledge Base.
What it boils down to is that this is an artifact of the way they have set up their plug-in architecture; the details are in the articles. I’d like to point your attention to one particular passage:
In Internet Explorer 4.x and 5, the browser first generates a GET request to the server. The server responds with the content-type, and the browser looks at the registry to check which application it will invoke. Then the browser generates a second GET request, and, after the server responds with the same content-type, the browser invokes the targeted application inside the browser window. Lastly, the browser sends a third GET request, and this time the browser renders the content of the server file inside the browser and completes the process. Internet Explorer 5.5 uses the same method but sends two GET requests instead of three.
Yes, you read that right. Internet Explorer sends three separate requests for the same thing! (Actually, I’m sorry, they say they’ve got it down to two. That’s a 33% increase in speed. Bravo.)
This is more than a little inconvenient, but fortunately Microsoft has a solution for us:
To work around this limitation and to considerably improve the performance of your application, watch for the “contype” userAgent request and only return the content-type.
Oooooooooh! It’s just that easy! Watch for “contype,” huh? That’s great. Such a great idea, in fact, that I’m sure the smart folks over at the World Wide Web Consortium would be using it. Let’s take a look.
Funny, that search returns only two results, and those are both listserv questions.
</sarcasm>
Having to send three or even two separate requests over the network for the same resource is braindead. It’s just wrong. Why wouldn’t you just save the resource the first time and reference it locally from then on?
But here’s the point: even if this was the only way for them to solve their plugin problem, there is still a better way of handling it! If Microsoft had bothered to read the HTTP spec, they would have discovered this:
The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request.
So all those times they’re asking for the content and then throwing everything but the header away? They don’t have to do that. They can just ask for the header and be on their merry way, and only ask for the body when they need it.
But this was supposed to be an explanation of why non-geeks might have reason to be upset at this, so here’s the really sinister part of the story: this “try once, try twice, third time’s the charm” approach is something that MSIE uses. How much do you want to bet IIS, Microsoft’s web server offering, understands this undocumented dance? And what would you guess the rest of the servers do when they receive a GET request? You know, the other 80% of servers on the net that obey standards? They probably do what the standard says and push two copies of the content across the wire.
Which is what Apache does. Apache is the web server my ISP runs, and I’m glad of it. But in this case, Hurricane using Apache has caused some serious extra bandwidth to be calculated for me. The actual number is astonishing: 22GB.
Microsoft owes me $550, and I don’t even use their shitty browser!
So the next time someone tries to get you to use Internet Explorer, remember this little story and cringe. And then do what all the D.A.R.E. kids did: JUST SAY NO!
The sites you surf will thank you.
Mr. Green Said,
July 5, 2004 @ 20:25
Nick, Mr. Green needs to talk to you, or something... it is in your best interest too... evil smile... evil laugh... muuahahaha.
Please don’t make me stalk you, I’m too lazy.
Sean Said,
July 6, 2004 @ 23:00
On your song of the week page, why not convert it into simple PHP or Perl - for browsers != IE, provide a link to the actual MP3. For browsers == IE, simply put a disclaimer at the top: “Incompatible Browser Detected. Please switch to Mozilla to access the song of the week.”
Just my $0.02.