Static Sites

I first started web development in 2013 by learning HTML and CSS. I created simple photography and portfolio sites with unnecessarily complicated nested DIVs and terribly written CSS. I remember wondering why DOM elements could have classes because I just put IDs on everything and styled them directly. Like most web developers, my journey lead me to learn JavaScript. First JQuery, followed by frameworks such as Angular 1, EmberJS, React, and Elm.

After learning these frameworks I was convinced that the future of the web was single page apps. Myself, and many other developers create SPAs for the simplest sites. I believe this trend of using the latest and greatest framework for everything has made some of us forget just how useful dead simple static websites can be.

Benefits of Static Sites

  • Works on all web browsers
  • Small file sizes (fast)
  • Works for noScript users
  • Content is more cache friendly

Benefits of JavaScript Frameworks

  • Good for content that is constantly changing
  • Load content without refreshing the page
  • Best for web apps

Closing Thoughts

I wrote this post so that I (and hopefully others) remember that the web was literally created to serve static content. Only in the last 10 years have we hacked it to make it work with dynamic content. Before immediately reaching for the newest JavaScript (or Elm) framework, take a step back, consider all the options, and choose the best tool for the job.

tag: web

Last Updated February 27, 2021