Learning Objectives

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

  • Define static and dynamic pages and group their differences.
  • Explain client side versus server side execution.
  • Choose a delivery approach for a BBA website.

Related: client server architecture, HTTP, email, FTP, world wide web and search engines.

Static pages

A static page is delivered exactly as stored. The server finds the HTML file and sends it. Every visitor sees the same content until someone edits the file.

Built with HTML and CSS, often with images and a little JavaScript for menus. Hosting is cheap, caching is simple, security surface is small because no database runs.

Use cases: a college brochure page, a restaurant menu, a coming soon page, a department portfolio whose content changes twice a year.

Trade offs: fast because nothing is computed per request, but manual HTML edits are needed and there is no per user data without an external service.

Dynamic pages

A dynamic page is built per request. The server runs code, reads a database or API, assembles HTML, and sends the result. Content can differ by user, time, location, or inventory.

Built with a server language such as PHP, Python, or Node.js and a store such as MySQL or Postgres. A CMS such as WordPress is a dynamic application that writes pages for editors who do not touch HTML.

Use cases: Daraz search results, Facebook feeds, exam portals, bus ticketing, and any login that shows my data.

Trade offs: flexible and updatable by non developers, but slower per hit, needs patching, and exposes a database to the internet.

flowchart TB
  R[Browser request] --> D{Page type}
  D -->|Static| S[File sent as stored]
  D -->|Dynamic| A[Server code runs]
  A --> DB[(Database or API)]
  DB --> A
  A --> G[HTML assembled per request]
  S --> V[Browser renders]
  G --> V

Three lenses to compare

Skip the two column list alone. Use three lenses that decide for BBA projects.

Lens Static Dynamic
Produce who updates content Developer edits files Editor uses a dashboard, no HTML needed
Deliver how the server responds Same file for all, cached at edge Script plus store, built per visitor
Protect risk and cost Small surface, cheap hosting Larger surface: injection, auth, updates, stronger hosting

One sentence to choose. If content is public, uniform, and rarely edited, static wins. If content is personal, searchable, payable, or updated by staff, dynamic is required.

Client side versus server side

Even static pages can be interactive. The difference is where code runs.

Runs on Client side Server side
Location Browser Web server
Language JavaScript PHP, Python, Node.js, Java, C#
Typical work Validate a form before submit, slide an image carousel, filter a list Check a password, query orders, charge a wallet, send email
Data access Cannot reach the server store directly Reads and writes the store

Most business sites use both. The browser checks format, the server checks truth.

Modern blends

A static site generator (Hugo, Eleventy) builds many static files at publish time from markdown and templates, often with a headless CMS. It feels dynamic to editors but delivers static files to visitors, which is fast and cheap. For many small business sites, this blend is the sweet spot: editors get a dashboard, visitors get static speed, no live database is exposed.

Self-check

Nepal worked example: static versus dynamic for a Pokhara lodge (NPR, BS 2081)

A 12 room lodge in Pokhara plans its first site on 2081-04-25.

Option A static with generator and a booking widget from a third party:

  • Design and 8 page build: NPR 35,000 one time
  • Domain and static hosting: NPR 4,500 per year
  • Widget fee: 2 percent on online bookings
  • Editor training: NPR 2,000

Option B full dynamic with login and local booking engine:

  • CMS or custom build: NPR 110,000 one time
  • Hosting with database, backups, SSL: NPR 18,000 per year
  • Maintenance: NPR 3,000 per month = NPR 36,000 per year

For year one, Option A costs 35,000 + 4,500 + 2,000 = NPR 41,500 plus widget commission. Option B costs 110,000 + 18,000 + 36,000 = NPR 164,000. If the lodge takes 240 online nights at NPR 4,000 average and widget fee is 2 percent, commission is 19,200, so Option A total is 60,700. Gap to Option B is about NPR 103,300.

The lodge should choose Option A and fund photography and map listings with the difference. It can move to full dynamic only if it needs its own availability rules, paid vouchers, or loyalty balances that a widget cannot store.

Summary

Static delivers a file. Dynamic assembles a page per request. Produce, deliver, and protect are the three lenses to choose between them. Client side runs in the browser, server side runs on the host and owns the truth. Static with a generator often gives small firms the editor they need with the speed and price they want. A shop that truly needs logins, carts, or per user data must pay for dynamic and maintain it.

Key Takeaways

  • Static shows the same stored file to everyone. Dynamic builds per request from code and data.
  • Three lenses: produce (who edits), deliver (how it is served), protect (risk and cost).
  • Client side validates and animates. Server side authenticates, queries, and charges.
  • Static is fast, cheap, and safe. Dynamic is flexible, interactive, and costly.
  • A generator is a practical middle ground for many BBA sites.

Review Questions

  1. Define static and dynamic with one example each.
  2. Walk through what the server does for a dynamic profile page.
  3. Use the three lenses to recommend static or dynamic for a college notice site.
  4. Where does client side stop and server side begin for a checkout form.
  5. When does a generator beat both pure static and pure dynamic.