Toy 7 · two minutes

Static or dynamic?

A crowd opens the same site at the same time. Change the kind of site and the size of the crowd, and see who waits.

The gateway hands over files

Everyone gets the same ready files, from the gateway's cache. Nothing is computed for a visitor.

How long they wait

The first visitor
0.1 s
The last visitor
0.1 s

As fast for the thousandth as for the first.

The times are illustrative: a small server (2 processors), about 40 ms of computing per dynamic page, no cache.

The same files for everyone, or a page made on the spot

A static site is a folder of ready-made files: everyone gets the same ones, and the server just hands them over. A dynamic site runs code on the server at every visit: it finds out who you are, reads from a database and makes the page on the spot. When many come at once, every dynamic page takes some of the server's time, and the others wait.

A portfolio, a band's site, a diary or a CV only change when you change them, so they can be static: fast, cheap and hard to break. You need a server for accounts, for data many people change (comments, stock, bookings) and for what has to stay private.

On weird, a static site lives in storage and the gateway serves it at your domain. A dynamic one runs on a server of yours or, while you work on it, through a tunnel from your laptop.

More in the course

In the terminal

# a static site: the folder, put in storage$ weird storage add ./site# a dynamic one needs a server: the sizes and their credit charges$ weird servers tiers
Every command and its flags, in the documentation

Tell your assistant

„I want a site for [what you do]. Tell me whether it can be static or needs a server, and why. If it can be static, make it that way.”