Skip to content
BENIBIX Learn

Static and Dynamic Websites

Level 1 · How a website works

Why some sites send the same file to everyone while others build each page as you ask. Where a web app fits, and how to tell which one you need.

Course contentsLesson 2 of 14

After this lesson you can

  • Tell a static site from a dynamic one
  • Say what makes a site a web app
  • Pick the simpler kind for a job

9 mincovers 3 glossary entries

Worth reading first: Front End and Back End

How a static site differs from a dynamic one

A static website is a set of files made ahead of time. Every visitor gets the same page, whether there are 10 of them or 10,000. A dynamic website builds each page at the moment it is asked for. It often reads from a database, so two people can see two different pages.

A static site is simple to run. The server only has to find a file and send it. Nothing is worked out, so it is fast, cheap and hard to break. Many static sites cost nothing to host. A page about yourself, a menu or a page for a small shop fits well.

The weak spot is change. To fix a price on a static site, someone edits the file and puts it back on the server. A site with thousands of pages that change every hour cannot work that way. That is the job a dynamic site was made for.

A dynamic site runs code on the server for each visit. It asks the database for the newest posts, fills them into a page, and sends the result. It can greet you by name, show your own basket and list only the items in stock. Each page costs a little work to make.

A web application goes one step further. It is a program you use inside the browser rather than a page you read. Email, maps and online spreadsheets are web apps. There is nothing to install, and the newest version is waiting every time you open it.

The two kinds also mix. A blog may be static for its posts and still run a small piece of server code for its comment box. So the real question is not which kind a site is. It is which parts of it need to change for each visitor.

People often pick a dynamic site because it sounds more grown up. But it brings a server to keep safe and a database to back up. It has more parts that can fail. If every visitor would see the same page anyway, the static kind is faster and safer.

Plain files go straight back to the browser. A dynamic page takes a detour through code and a database.

Worked example

Jack moves his band's site

Jack's band site has 6 pages and changes about once a month. It was dynamic, with a database he never used, and it went down twice last year.

He turns it into 6 static files. It now loads in half the time, costs nothing to host, and has nothing left to break.

The words for this lesson3

Check yourself

What makes a site dynamic, and not static?

Finished this lesson?

Marking it complete also marks its 3 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.