Learning Objectives
By the end of this chapter, you will be able to:
- Differentiate between the Internet and the World Wide Web.
- Describe the function of a web server and a web browser.
- Define a URL.
- Identify HTTP as the protocol of the web.
Understanding the World Wide Web
The World Wide Web (or “the Web”) is the most popular service that runs on the Internet. It was invented by Tim Berners-Lee in 1989/1990 while working at CERN. It is important to remember: The Internet is the “plumbing” (hardware/protocols), and the Web is a “service” (software/content) built on top of it.
1. Hypertext and HTML
The Web is based on Hypertext—text that contains links to other text.
- HTML (Hypertext Markup Language): The standard language used to create web pages.
- HTML5: The latest version, which allows for embedded video, audio, and interactive features without needing extra “plugins.” This is critical for modern mobile-first e-commerce.
2. HTTP and HTTPS: The Request-Response Cycle
HTTP (Hypertext Transfer Protocol) is the “language” used by web browsers and servers to talk to each other.
The Cycle:
- Request: Your browser (the Client) sends a message like
GET /index.html HTTP/1.1. - Response: The server sends back the file along with a status code (e.g.,
200 OKif successful, or404 Not Found).
sequenceDiagram
participant B as Web Browser
participant S as Web Server
participant A as Application Server
participant D as Database
B->>S: HTTP GET /products/laptop
S->>A: Forward request
A->>D: Query product data
D-->>A: Return product info
A-->>S: Generate HTML response
S-->>B: HTTP 200 OK + page content
Figure 1: Web request-response cycle for an e-commerce page
HTTPS (Hypertext Transfer Protocol Secure): This is the encrypted version of HTTP. It uses SSL/TLS to ensure that data sent between your browser and a website (like your credit card or eSewa password) cannot be intercepted.
3. URLs: The Global Address System
A URL (Uniform Resource Locator) tells your browser exactly where to find a resource.
- Structure:
https://(Protocol) +www.daraz.com.np(Domain) +/products/laptop(Path).
4. Web Browsers vs. Web Servers
- Web Browsers (The Client): Software like Chrome, Safari, or Firefox. Its main job is to render HTML/CSS code into a visual page and execute JavaScript (the logic).
- Web Servers: Software like Apache or Nginx that “listens” for requests and delivers the necessary files. In e-commerce, web servers often talk to Application Servers (to handle logic) and Databases (to fetch product info).
5. Static and Dynamic Web Pages
| Feature | Static page | Dynamic page |
|---|---|---|
| Content | The same for every visitor | Built for each request from a database and user data |
| How it is made | A fixed HTML file stored on the server | Generated by server code (PHP, Python, Node.js, Java) |
| Example | A shop’s “About us” or “Contact” page | Product search results, a shopping cart, order history |
| Strengths | Fast, cheap to host, secure | Personalised, always up to date |
An e-commerce site mixes both: static pages for fixed information, dynamic pages for anything that depends on stock, prices, or the logged-in customer.
6. HTTP Status Codes
Every HTTP response carries a three-digit status code.
| Code | Meaning | E-commerce example |
|---|---|---|
| 200 | OK | The product page loaded normally |
| 301 | Moved permanently | An old product URL redirects to the new one |
| 404 | Not found | A deleted product link was shared on Facebook |
| 500 | Internal server error | The checkout code crashed |
| 503 | Service unavailable | The site is overloaded during a flash sale |
7. Cookies and Sessions: How a Shopping Cart Remembers You
HTTP is stateless: each request is independent, and the server does not remember previous ones. To build a shopping cart, sites use:
- Cookies: Small text files the website stores in your browser. A cookie holds an ID that the browser sends back with every request.
- Sessions: On the server, that ID is linked to your cart, login, and preferences.
When you add a phone case to your cart on one page and open the checkout page later, the cookie ID tells the server which cart is yours. Cookies are also used for analytics and advertising, which is why privacy laws and browsers now limit third-party tracking cookies.
8. The Evolution of the Web
| Stage | Main feature | Example |
|---|---|---|
| Web 1.0 (1990s) | Read-only pages published by organisations | Early company brochure sites |
| Web 2.0 (2000s on) | User-generated content, social sharing, interactivity | Facebook, YouTube, product reviews |
| Mobile and app web | Content designed for smartphones and apps first | Daraz app, wallet apps |
| Semantic and AI web | Machines understand content; AI search and assistants | Rich search results, AI shopping helpers |
The Digital Web in Nepal
The web in Nepal has evolved from simple informational pages to complex interactive platforms.
1. Popular Nepali Web Portals
- News & Information: Onlinekhabar and Ratopati are leading digital news sources.
- Utilities: Hamro Patro is the “Swiss Army Knife” of the Nepali web, offering calendars, news, and exchange rates.
2. Government Web Services (Digital Nepal Framework)
The Government of Nepal is increasingly moving services online:
- e-Government: Portals for Online Tax Payment, Driving License Status, and Passport Appointments.
- Nagarik App: A unified “Super-app” and web portal designed to provide citizens with various government services in one place.
3. The Importance of Unicode
Standardized Nepali Unicode has been vital for the growth of the local web. It allows Nepali text to be indexed by search engines like Google, making local content discoverable globally.
Discussion Questions
- What is the difference between Static Web Pages and Dynamic Web Pages? Which one is used for an e-commerce cart?
- Why is HTTPS mandatory for modern e-commerce websites?
- Name three Nepali websites that use Dynamic Content to provide personalized experiences.
Summary
The Web is a service that runs on the Internet. It is built on hypertext written in HTML, delivered by the HTTP request-response cycle, and located by URLs. Browsers render pages, and web servers work with application servers and databases to build dynamic pages such as product listings and carts. HTTPS encrypts this traffic, status codes report the result of each request, and cookies and sessions let a stateless protocol remember a customer’s cart. The Web has moved from read-only pages to social, mobile, and AI-driven experiences, and in Nepal it now carries news, utilities, commerce, and a growing range of government services.
Key Takeaways
- The Internet is the infrastructure; the Web is a service on top of it.
- HTML structures pages; HTTP/HTTPS carries them; URLs locate them.
- Dynamic pages are built from databases for each request; static pages are fixed files.
- HTTP is stateless; cookies and sessions make shopping carts possible.
- HTTPS is essential for any page that handles logins or payments.
Exam-Style Questions
Short answer
- Distinguish between the Internet and the World Wide Web.
- What is HTTP? How is HTTPS different?
- Explain the parts of a URL with an example.
- What is a cookie?
- What does the HTTP status code 404 mean?
Long answer
- Describe the request-response cycle when a customer opens a product page on an e-commerce site.
- Compare static and dynamic web pages and explain why e-commerce sites need dynamic pages.
- Explain how cookies and sessions allow a shopping cart to work over a stateless protocol.

