Static vs. Dynamic Hosting¶
One of the first decisions that you need to make when building a site is whether it will need a dynamic backend or whether a purely static site will suffice.
The webpage you are viewing is a collection of files:
- HTML files provide the structure and content of the page
- CSS provides styling (colors, fonts, spacing, etc.)
- JavaScript provides interaction.
- Image files for icons, etc.
When you visit a URL like https://view-source.org/ your browser fetches an index.html and any files it references.
The end result is a webpage like the one you're viewing now.

This is what is known as a static website.
Most sites today are dynamic— what you see in your browser when you use these sites is still HTML, but instead of being a file like index.html the HTML is generated dynamically. This typically involves content stored in a database.

Dynamic sites are necessary when you need user-editable content or faceted search: social networks and retailers are powered by web applications that generate HTML on the fly.
Since dynamic sites can do anything a static site can do, and more, it is tempting to think of static sites as obsolete or inferior. In fact, there are many benefits to using a static site when dynamic content is not an integral part of the experience.
Benefits of Static Sites¶
If the purpose of a site is to provide information, not be interacted with, it is probably a good candidate for a static site. Another way to think of it: if you don't need people to log in and are serving every visitor the same page— those pages can be static HTML.
Simpler¶
It may not be obvious, but a dynamic site requires regular maintenance. The application can crash, fill up the disk, need software upgrades, etc. Operating system & package updates may necessitate changes to code that was otherwise working.
Static sites are just a bundle of unchanging files. Once published, as long as the server itself remains online, the files will be available.
This is why static sites from the 1990s still work today, where dynamic web applications from just years ago are often no longer maintained or online.
Easier and cheaper to host¶
A server that is hosting your dynamic application needs the correct version of the programming language and any libraries installed. It needs to run your application in response to every request, which takes more time and computational power than simply replying with the contents of a file.
For this reason, while there are ample options for free/nearly-free static hosts, most of which can scale to thousands if not millions of users-- dynamic hosting providers have very modest free tiers typically not suitable to anything more than testing & development.
The hosts themselves are also more volatile, plenty of static hosts have existed unchanged for a decade or more, where dynamic hosts are constantly changing offerings to keep up with the evolving needs of dynamic applications.
More secure¶
A static site has relatively few potential security issues. If the server itself is secured, preventing defacement of the files, there's very little to worry about-- there is no database filled with credentials, there are no security patches to apply, etc. (TODO 3rd)
This does not mean you are writing every page by hand.