Serving Web Pages
How web pages are served
Web pages are served using a server – client relationship.
- The user enters the URL of the website/web-page to be loaded into a web browser. The browser looks in the computer’s DNS cache to see if a matching IP address is stored.
If none is found then a request is sent to the ISP’s DNS resolver server to find out the IP address (NOT Found → step 2, found → step 4). - The DNS resolver looks for the IP address and if it is stored the DNS Server returns the IP address to the originator.
- If it is not found it is passed on to a higher level DNS. Once found the original DNS caches the IP address for future use and returns the IP address to the user.
- The browser uses the IP address to send the web page request to the web server.
- The web server retrieves the page and sends it to the originator.
- The browser interprets the script and loads the page.
Tutorial Video
Can’t access YouTube? Click Here for the Google Drive version.
Client Side Scripting
Client Side Scripting
With client side scripting the script is executed on the client machine.
- The code is embedded within the web page itself.
- The code is interpreted by the web browser.
- The most common form of server side scripting is JavaScript.
- Any persistent data is stored on the client machine using Local Storage / Cookies
Activity
Try out some client side scripting here on the W3Schools Website
Server Side Scripting
Server Side Scripting
With server side scripting the script is executed on the server. The most common form of server side scripting is PHP
Any persistent data is stored on the server, usually in an SQL database.
Server side script execution process:
- The client’s web browser requests the web page page.
- The web server accesses the page/resource.
- The web server executes the code.
- The web server generates the web-page.
- The web server returns the page to the client
- The web browser displays the page