0.5.6 What Happens When You Visit a Website?

Visiting a Website Starts a Chain of Events

When you enter a URL and press Enter, a lot happens quickly.

The page may appear almost immediately, making the process feel like one action.

It is more useful to think of it as a sequence.

At an introductory level:

  1. You provide a URL.
  2. The browser interprets the URL.
  3. The browser determines how to reach the destination.
  4. The browser sends a request.
  5. The server receives and processes the request.
  6. The server sends a response.
  7. The browser interprets the response.
  8. The browser displays the result.

Each step has a different responsibility.

The URL Identifies What You Want to Reach

Suppose you enter:

Activity diagram showing HTML, then CSS, then browser rendering, then visible page.
HTML.
  • New
  • Changed
  • Removed

The browser is responsible for turning those digital representations into the visual experience the user sees.

The Page Can Trigger More Communication

The interaction does not necessarily stop when the first page appears.

A page can cause additional requests when:

  • images are loaded;
  • stylesheets are loaded;
  • the user follows a link;
  • a form is submitted;
  • the page requests more information.

For this module, keep the focus on one basic request and one response.

The larger idea is that web use is an exchange between systems.

Separate Network Movement From Browser Rendering

Two different things are happening:

Communication

Information moves between client and server.

Rendering

The browser interprets returned web resources and displays the page.

A networking problem can prevent the response from arriving.

A markup or styling problem can affect how an arrived response is displayed.

Separating those stages helps you reason about where a problem might occur.

A Simplified Website-Visit Story

Keep this sequence in mind:

Activity diagram showing User enters URL, then Browser interprets destination, then Browser sends request, then Server processes request, then Server sends response, then Browser interprets resources.
UserEntersURL.
  • New
  • Changed
  • Removed

That sequence becomes easier to model when client and server responsibilities are placed in separate UML activity partitions.