Skip to content

Lesson 2 of 3

What happens when a page loads

2 min

Between typing an address and seeing a page, several systems work in sequence.

The request path

  1. DNS turns the domain into the server's IP address.
  2. The browser opens a TCP connection to port 443 and performs a TLS handshake to encrypt the traffic.
  3. It sends an HTTP request, e.g. GET /pricing.
  4. The web server (Nginx, Apache or LiteSpeed) receives it. A static file such as an image is returned directly.
  5. A dynamic page is passed to the application: PHP for WordPress, or Node.js, Python and others.
  6. The application usually queries a database (MySQL or PostgreSQL) and builds the HTML.
  7. The response travels back with a status code: 200 OK, 301 redirect, 404 not found, 500 server error.

Where speed comes from

  • Caching: storing a finished page so steps 5 and 6 are skipped for the next visitor.
  • A CDN: copies of static files on servers close to the visitor.
  • Fast storage: NVMe drives make database reads much quicker.
  • HTTP/2 and HTTP/3: many files over one connection.

The most common cause of a slow site isn't the server. It's an unoptimised application making too many database queries or loading huge images.

See it yourself

curl -I https://insidx.com

-I shows only the response headers: status code, server and caching information.