Luke Collier

Software Engineer

Static Websites for Great Good

Reading time is 4 minutes

While creating this website from the wonderous Zola, I got thinking about the applications of a static site for more then a blog. A full web application that can run entirely from a cdn with all the benefits (and problems) that would cause? Further more could we have low level atomic experimentation on the smallest of html changes?

<tl>
  We're gonna put Airbnb in a cdn.
</dr>

Yes.

Historical

Originally website were a single html document. The glory days my vision of perfection! With time new technologies were added giving client side logic, webservers that could change the document before it was formed, databases were bolted on to give a unique experience to every user! How can we replicate these complex behaviours with a load balancer and a cdn?

The problem

For the sake of this article we shall focus on fluffy theoretical ways we could accomplish a purely cdn driven website with enough complex features to be indistinguishable from your airbnb's of the world. But with that goal we will need to emulate a set of features I feel are imperative to a successful tech company:

On top of these arbitruary requirements I have a few goals and reasonings behinds this approach

The idea

Actually getting the site running with content is simple enough and Hugo and Zola provide options for localization which takes care of that as well so these steps are completed for us presuming we choose a static site generator. The rich ui elements can be accomplished with and bind it to the html, simple but effective for now! Sessions will be cheating a bit, the load balancer will have to have some mechanism for signing and forwarding JWT's. Experiments is an interesting one, the obvious answer is to create some form of templating extension and allow fancy blocks like:

[# experiment <name> do
  <div></div>
else
  <span></span>
#]

that results in two bundles, one with the <div></div> the other with the <span></span> the name of these bundles should be reproducable or recorded to be sent to a load balancer that will handle the routing.

Summary

Over the next few months I intend to start some opensource projects, each with a corresponding blogpost explaing what part they will play in making this concept a reality. They will all be moving the server rendering to the build step.