Web applications work quite different from regular windows applications. This chapter explains the fundamentals of a web application and how a web page is served when a client makes a request for a web page.
Web applications work quite different from regular windows applications. There are several computers involved when you view a web page.
Life Cycle of a Web Request
Viewing a web page is a simple process for a visitor. Just type the URL in a web browser like Internet Explorer or click on a hyper link in any existing web page. The web browser will display the page instantly to you.
But do you know that there are several computers involved in this process? Even though it is a very complex process, we can summarize the process as shown below:
01. You type the web page address (URL) in a browser. For example, consider the current page http://www.example.com/tutorials.aspx. This URL has 3 parts:
- The protocol - http:
- The file name - tutorials.aspx
- The server name - www.example.com
03. Browser established a connection to the web server at that IP Address.
04. Server composes a 'Request' for the specified URL and sends the request to the web server to which it has established a connection.
05. The web server identifies the type of the page requested. If it is an asp.net web page, then browser knows that needs some processing by the asp.net service running as part of the web server. The request is handed over to the asp.net service. The asp.net service processes the asp.net page and generates the html output.
06. Web server sends the requested page to the browser.
07. When a response is received by the browser, it displays the web page to the user who typed the URL.
After you typed the URL in the browser, the request sent by the browser may go through several computers in the internet before it reaches the actual web server.
You must be surprised to know that so many things happen and several computers are involved before a simple web page is displayed to you. Most of the steps in the above process happens behind the screen. A visitor need not worry about how a web page is processed and served to the browser.
So, by now you must have got a better picture about how a windows application is different from a web application. When you run a windows application (desktop application), only one computer is involved in the whole process. You start an application in your computer and it runs in your computer. But when you request a web page from your home computer, the request goes through several servers in the internet and finally it reaches a computer called 'Web Server'. The actual web page is processed in the web server.