Wednesday, November 10, 2004

How the Web Works: HTTP and the Your Mother

I'm going to try my had at a metaphor here and say that a web page is like a cake. Let's say for instance, you ask your mother to make you a chocolate cake. Lets compare this to asking your browser to get you a webpage. Your mother is going to open the phone book and find the grocery store. Your browser is going to request, from the authorities, where the web server is. Your mother is going to go to the store and ask the grocer for the chocolate cake mix. Your browser is going to connect to the server and request the page that you asked for.

Now, an HTML page is very similar to a cake mix. It contains a large amount content, references to what other content you need, and instructions on how to put it all together. So, the browser is going to look at the HTML file and see what else it needs. This could be images, flash movies, other sets of instructions, or even other HTML pages. Your mother will look at the required ingredients and ask the grocer for them. So now that your mother has the mix, the oil, and the eggs, she can go home and cook you a cake. The browser has now gotten the images and styling instructions from the web server, so it will start to draw your web page.

Just like the box of cake mix, an HTML document contains instructions for drawing that page. Your browser will read that document, and put all the pieces together. It will pour in the images when necessary and it will follow instructions to make text bold and draw the background in the proper color. In the end, your mother has a beautiful cake to give you, and your browser has served up a steaming hot web page, fresh for your enjoyment.

This is, obviously, an oversimplified example. For instance, my mother already knows where the store is. Well guess what: your web browser remembers where sites you frequent are, so it doesn't have to ask for directions every time you request itchybutt.com. My mother usually already has eggs in the fridge. A web browser has a place where it remembers graphics and other files from sites you frequent. That's why logos and other common graphics tend to show up first on slow connections. They're already on your computer.

Sometimes, the grocer that has the cake doesn't have all the ingredients necessary to bake that cake. The browser is much less bothered by needing to look elsewhere for an ingredient. It just goes back to the authoritative server and asks for directions to the other server. And finally, some bakers, such as those in high altitudes have special baking needs and require special instructions. HTML even has that covered. It allows for special instructions for people who are blind, or need large print, or otherwise. There are even special browsers out there that can read a web page to a blind user.

So think about all that goes into one simple web page. Your browser works hard for you. Maybe you should show your appreciation by making it a cake. And since your browser can't really enjoy a cake. Just send it to me.



Questions and/or Comments are welcome and/or appreciated.

No comments: