8. Topic 8(COLON) Web Technologies

Lesson 8.1: The World Wide Web And How A Page Is Delivered

Official syllabus section covering Lesson 8.1: The World Wide Web and How a Page Is Delivered within Topic 8: Web Technologies: The internet as infrastructure versus the web as a service running on it.; URLs, the client-server request and how a browser renders a page..

Lesson 8.1: The World Wide Web and How a Page Is Delivered

Introduction

In this lesson, students, we will explore the fascinating world of the Web and how web pages are delivered to users like you. You will learn the fundamental differences between the internet and the World Wide Web, the structure of URLs, how client-server communication works, and how web browsers render a webpage. Our goal is to provide you with a comprehensive understanding of the technology behind web pages and the process that delivers them to your screen.

Learning Objectives

By the end of this lesson, you will be able to:

  • Understand the internet as infrastructure versus the web as a service running on it.
  • Explain URLs, the client-server request, and how a browser renders a page.
  • Describe web servers, hosting, and domains at an overview level.
  • Understand the division of work between client-side and server-side technologies.
  • Distinguish between the internet and the World Wide Web.

The Internet vs. The Web

Before diving into web technologies, it is crucial to differentiate between the internet and the World Wide Web (WWW).

The Internet as Infrastructure

The internet is a vast network of interconnected computers and devices that communicate with each other using standardized protocols. It can be visualized as the backbone that supports various kinds of information and services, like email, file transfer, and the World Wide Web.

  1. Definition: The internet is a global system of interconnected computer networks that utilize the Internet Protocol Suite (TCP/IP) to link billions of devices worldwide.
  2. Infrastructure: It includes physical components such as servers, cables, routers, and data centers.
  3. Function: The internet enables the transmission of various types of data and provides functionality for applications to interact.

The World Wide Web as a Service

The World Wide Web is not the same as the internet. Instead, it is a collection of interconnected documents and resources, accessed via the internet using web browsers.

  1. Definition: The World Wide Web is a system of interlinked hypertext documents accessed through the internet.
  2. Service: The web utilizes protocols such as HTTP (HyperText Transfer Protocol) to deliver content to users.
  3. Components: The WWW consists of web pages, which are created using HTML (HyperText Markup Language), styled with CSS (Cascading Style Sheets), and made interactive with JavaScript.

Summary

In summary, the internet serves as the underlying infrastructure, while the World Wide Web is a service that runs on top of it. Understanding this distinction is vital, as it lays the groundwork for how web technologies function.

Understanding URLs

Next, we will discuss one of the core components of web technology: URLs (Uniform Resource Locators).

What is a URL?

A URL is the address used by web browsers to access resources on the web. It provides a way to specify the location of a resource on the internet.

  1. Structure of a URL: Let's break down the structure of a URL using an example:
  • Example URL: https://www.example.com/path/to/resource.html
  • Protocol: https - specifies the protocol used (HTTP or HTTPS).
  • Domain Name: www.example.com - the unique name identifying the website.
  • Path: /path/to/resource.html - specifies the location of a specific resource on the server.

The Role of URLs in Web Browsing

When you enter a URL in the address bar of your web browser:

  1. The browser first resolves the domain name to an IP address using the Domain Name System (DNS).
  2. Once it has the IP address, the browser sends an HTTP request to the web server associated with that IP address.
  3. The server processes the request and sends back an HTTP response, which typically includes the requested web page.

Example of URL Resolution

Let's say you want to visit https://www.example.com. When you enter this URL in the browser, the following steps occur:

  1. DNS Lookup: The browser queries a DNS server to find the IP address of www.example.com, which could return 192.0.2.1.
  2. HTTP Request: The browser sends an HTTP GET request to http://192.0.2.1 asking for the homepage.
  3. Server Response: The server at this IP address receives the request, processes it, and responds with HTML content.
  4. Rendering: The browser then takes the HTML and renders it for you to see.

Common Misconceptions

  • HTTP vs. HTTPS: Some students may think these protocols are the same. HTTPS includes a security layer (TLS) that encrypts the data transmitted between the client and the server, making it more secure.
  • URL vs. IP Address: People often confuse URLs with IP addresses. A URL is human-readable, while an IP address is numerical and used by computers to communicate.

Client-Server Communication

In this section, we delve into how communication occurs between clients (web browsers) and servers.

The Client-Server Model

The client-server model is a distributed application structure that partitions tasks between providers (servers) and clients.

  1. Client: The client is typically a web browser that sends requests for resources. It acts as an interface for users to interact with the web.
  2. Server: The server hosts the web content and responds to client requests. It processes requests, retrieves data, and sends back responses.

Request-Response Cycle

  1. Request: When you enter a URL in a browser, the client constructs an HTTP request. This request contains:
  • Method: GET (request data from the server) or POST (send data to the server).
  • Headers: Additional information (e.g., browser type, accepted content types).
  • Body (for POST requests): Data sent to the server.
  1. Response: The server processes the request and sends an HTTP response, which includes:
  • Status Code: Indicates success (200), redirection (301), or errors (404).
  • Headers: Metadata about the response.
  • Body: The actual content (HTML, JSON, etc.).

Example of a Request-Response Cycle

Let's assume you want to log into a website:

  1. Client Sends Request: You enter your credentials and click 'Login'. The browser sends a POST request to the server with your data.
  2. Server Processes Request: The server checks your credentials against a database.
  3. Server Sends Response: If successful, it responds with a 200 OK status and directs you to your dashboard.

Common Misconceptions

  • Static vs. Dynamic Content: Some assume all web pages are static. Dynamic pages can change content based on user interaction, requiring backend processing.
  • Latency in Requests: New users may not realize that the time to load a webpage can be affected by factors like server health, network speed, and resource size.

How a Browser Renders a Page

After receiving a response from the server, the web browser must render the page for you.

Rendering Process

The rendering process can be broken down into several key steps:

  1. Parsing HTML: The browser reads the HTML document and constructs the Document Object Model (DOM), a tree-like structure representing the document.
  2. Parsing CSS: The browser applies styles by reading CSS rules, which creates the CSS Object Model (CSSOM).
  3. JavaScript Execution: The browser executes JavaScript code, which can modify the DOM and CSSOM, leading to updates in the layout.
  4. Layout: The browser calculates the position and size of elements, determining how they should be displayed.
  5. Painting: Finally, the browser paints the content on the screen based on the layout.

Example of Rendering a Page

  1. HTML Document: You receive an HTML document with several text elements and images.
  2. DOM Construction: The browser creates a tree structure from the HTML elements.
  3. CSS Application: CSS styles are applied, changing colors and layouts according to rules.
  4. Execution of Scripts: Any JavaScript updates the DOM, e.g., modifying text or adding dropdown menus.
  5. Final Display: The browser paints the page visually for you to interact with.

Common Misconceptions

  • Rendering Time is Instant: Many believe rendering is done instantaneously. In reality, rendering can take time depending on document size and complexity.
  • Browsers Render Pages the Same Way: Differences in browsers can lead to variations in how pages are rendered, affecting layout and functionality.

Conclusion

In this lesson, we covered the foundational concepts of the World Wide Web and how web pages are delivered to users. You learned about the differences between the internet and the web, the structure and importance of URLs, client-server communication, and the page rendering process.

As technology continues to evolve, having a solid understanding of these topics will serve you well in your future studies and careers in information technology.

Study Notes

  • Internet: Global network of interconnected devices.
  • World Wide Web: A service built on the internet using HTTP.
  • URL Structure:
  • Protocol: Indicates the method of communication (e.g., HTTP).
  • Domain: Unique address for a website.
  • Path: Specific location of a resource.
  • Client-Server Model: Divides work between users’ devices and web servers.
  • Rendering Steps:
  • Parsing HTML → Constructing DOM → Parsing CSS → Executing JavaScript → Layout → Painting.
  • Common Misconceptions: Differentiate between static/dynamic content, understand request/response cycles, and the influence of rendering times.

Practice Quiz

5 questions to test your understanding