Friday, March 09, 2007
One of the things that has been occupying a good portion of my time at work lately is page load times. Sounds simply I know but believe me it is more complicated than you think. So why are load times important? Simply put your customers feel that the speed of your site, reflects the level of service that you are trying to offer them. And to a certian extend that is true.  Also most users don't know the difference between a 5kb static html page, and a n-tier application, that connects to a database on the backend and connects to a web service to get a calculation for some complicated insurance rate algorithm.  Should they? No, not really, so it is our jobs and developers to make the two very different examples have the same load times. Is that really possible? No it's not, but there are certainly some things that can be done to help.  There is tons written on code optimization, so we will let other people talk about that. We are going to go over some web server optimizations that can be done. These apply to whatever server you are on, as these are just basic web development principles that we all know, but somehow don't have time to follow.

Just say no to 404 errors.
This sounds really simple, but is terribly important. Our external website gets 100,000 to 200,000 visits a month. Not to bad, however lets just say that you have a broken image in the footer. Well know you have a 404 error per page load, not so good. And depending on the image, the web servers response can actually be larger than the image you requested. So how do you know if you have broken images, besides the obvious little red box with an X. What if you use firefox and it just hides it. Well, that is where checking your work in mulitiple browsers comes in handy. I am firefox user, however the Add-on I use the most is IETab. You can quickly open a new browser tab in IE (Internet Explorer) or change the browser engine for the current page you are on. One warning though this creates a new session for the new browser engine.

Another great firefox Add-on that helps sniff out 404 errors is Live HTTP Headers. There is a Internet Explorer utility very similar to Live HTTP Headers called ieHTTPHeaders. Both of these utilities write out every HTTP Header requests. Of course it helps if you know what the HTTP Status Codes are to decypher what their output. Another application that I have found extrodiarily useful is Fiddler. This application is one of those apps, written by Microsoft, but isn't widely known. Fiddler acts as a proxy between Internet Explorer and your internet connection and records every request and response. Infact you can record a request/response session, save it and replay it. Fiddler is also extensible. A quick change of it rules.js and you can add HTTP Headers to every page request and even slow down connection speeds, to reproduce real world speeds.

304 is your friend
The 304 HTTP status code is one that just makes you smile. Basically it just tells the web browser that object it has requested has not changed, so just use what it has in cache. This is good news for your web server as it only sending a 1kb response instead of a entire page or graphic.

Two articles I've found amazingly useful
Article 1
Article 2

3/9/2007 10:53:54 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):