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 provides the structure and content of the page.
- CSS provides styling (colors, fonts, spacing, ...).
- JavaScript provides on-page interaction.
- Images and other files fill out the rest of the site.
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 become necessary when you need user-editable content or complex 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 primary purpose of a site is to provide information as opposed to allowing users to submit content, 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, it 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 can still work today, while dynamic web applications from just years ago are often no longer maintained or online.
Cheaper¶
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 very cheap or even 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 for anything more than testing & development.
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 or other routine maintenance needed.
When to Go Dynamic¶
It is likely worth considering a dynamic site when:
- Your site involves significant amounts of user-generated content: comments, uploads, etc.
- Your site is dynamically generated based on
frequently-changing information, like a storefront that updates current inventory. - You are using an existing server-dependent CMS or framework like WordPress.