Adventures In Real Life
Friday, March 09, 2007
Optimizing the Web, please wait...
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
General
|
Programming
|
Rant
|
Technology
3/9/2007 10:53:54 PM (Pacific Standard Time, UTC-08:00)
Comments [0]
Name
E-mail
Home page
Remember Me
Comment (HTML not allowed)
Enter the code shown (prevents robots):
© Copyright 2009 Russell A. Kelly
Theme design by
Bryan Bell
newtelligence dasBlog 1.8.5223.1
|
|
| Page rendered at 1/6/2009 1:13:58 AM (Pacific Standard Time, UTC-08:00)
On this page....
<
January 2009
>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
Search
Contact
Russell Kelly
I'm a Sr. Web Developer with 10 years of experience in Web Development.
About Me
Navigation
Home
Top 5 Technical Posts
Top 5 Family Posts
Categories
Apple
Art
Cars
Family
Funny
General
health
Motorcycles
Music
Photography
productivity
Programming
Rant
Technology
Blogroll
43 Folders
Chardy
The Adventures of Chardy
Coding Horror
Dad Gone Mad
Infinities Loop
David Reed explains how ASP.NET really works.
Joel on Software
Life Reboot
Lifehacker
Tech tricks, tips and downloads for getting things done
Photos of Real Life
PixieStitch
Yes, She's back and rock'n you sewing world
Scott Guthrie's Blog
Scott Hanselman
Super Green
A movement to invoke the City of Los Angeles and the State of California to take action on the pollution problems, particularly in the L.A. River and Bologna Creek
The Kneeslider
All things on two wheels
The Wayward WebLog
Tim Ferriss
Author of the four hour work week
Worst Than Failure
Zen Habits
Sign In