What is the difference between a static and a dynamic website?
Options
- Static sites have no images, while dynamic ones do
- Static serves fixed files; dynamic builds per request (Correct option)
- Static sites need a database; dynamic sites do not
- There is no real difference between the two kinds
Answer
A static site sends the same ready-made files to every visitor; a dynamic site builds each page on request, often with data from a database
Why
Static site: the server just finds a file (for example about.html) and sends it as it is. Everyone sees the same content.
Dynamic site: the server runs code, reads data (for example from a database), fills an HTML template and sends a page built for that request. A shop showing your orders is dynamic.
Static sites are simpler and cheaper. Dynamic sites are more flexible.
Remember
Static = same files for all. Dynamic = built per request.