Monday, October 8

Response to Ev’s posting form question

evhead: "Wow, the Blogger posting form sends down 30 Javascript files to your browser and 17 .gifs. Curious why they don't turn those 47 http requests into two or three. It would make a huge difference in responsiveness. Pete?"

Really? 47? I ran LiveHttpHeaders while loading the posting form, and here’s what I saw:

GET /post-create.g?blogID=16425656 HTTP/1.1
Host: www.blogger.com

GET /__utm.gif?utmwv=1&utmn=602865791&… HTTP/1.1
Host: www.google-analytics.com

How is it that Ev got 47 and I got 2? If you use curl on Blogger’s image and JavaScript files, you’ll notice that they’re sent back with rather generous cache headers. So, chances are the files are already in your browser:

> GET /img/gl.video.gif HTTP/1.1
Host: www.blogger.com

< HTTP/1.1 200 OK
< Cache-control: public
< Expires: Thu, 08 Nov 2007 02:14:31 GMT

Obviously, if the files are not in your cache, Blogger’s post editor will load more slowly, because it does have 47 or so files to download. If Blogger had the same code in fewer files, the initial loading would likely be somewhat snappier in non-cache situations. So it would have some effect, but, in practice, not always a “huge difference.”