Refresher on dynamic vs static websites

Vera
2 min readJan 23, 2017

--

So lately, while choosing the tools I needed to build a personal project, I realized I didn’t fully understand what static vs dynamic websites were.

Does this site look static to you?

Geek-0-meter

It’s the first site I built when learning React + Redux. It uses Github’s api to fetch the number of users registered in a given city, then makes a pie chart with Plotly.js, which shows you the relative number of users in each of the cities queried. It’s a static website, I didn’t know it then so I used Heroku to deploy it, which is a tool that’s more useful for dynamic websites. Had I known, I could have used a simpler tool, like surge.sh or github pages to deploy my site.

To be exact, the site above is a single page application. Because, although the content dynamically reacts to a user’s input, it is actually loaded only once onto the user’s browser and all subsequent changes are made through front-end code making requests to apis, fetching responses, and updating the view.

Had this been a dynamic site, then it would have been the server’s responsibility, upon receipt of the client’s query to build a new view and serve it back to the client. Each request would have resulted in a response with a completely new view, instead of simply the small piece of info, in this case, the number of users per city.

There are many resources debating pros and cons of dynamic vs static sites. I don’t want to get into it here. It’s just that I’ve had a little aha moment here and wanted to share it with you.

And a few nice reads:

--

--