Static Sites Are Not So Static

Static websites refer to websites where the html of the page was rendered before your request was ever sent to the server. This is without exceptions the best performance possible: delivering flat html files which can be distributed over a content delivery network. This requires robust build time capabilities for turning various streams of code and content into the end result web page that the user sees. However it is not as limiting as someone who comes from a strong server side generation background might think.

To start, a static site can be a single page application as long as the body content of each page is available from the server along with the full html page. If this is the case then client side JS can be used to load in only the body content of new pages after the initial page load.

Static sites can also be progressive web apps and can be available offline. Nothing about PWA's prevents a static site from utilizing these features. In fact limiting tight server side coupling makes these features even easier.

Lastly, dynamic, API driven interactive features with user specific content are also easily available with static site generation and even work best when decoupled from the server. Pre-rendered HTML content, along with CSS and JS can be loaded with the speed advantages of static site generation. Then, the dynamic features of the application can loaded after the page load by JavaScript.

Pre-rendering HTML content with build hooks provides the best possible performance, neither slowing down page load time or slowing down the page after it has been loaded with costly templating libraries and frameworks. All of this is possible without losing the possibility of dynamic, feature rich applications that we have all grown to expect out of the web.

With these principles in mind I have begun working on OrisonJS. A static site generator that will come with all of these modern web platform principles in mind. I already have some documentation on the site - but stay tuned as the features are rapidly evolving towards an initial release.

Comments

Popular Articles

The Vanilla Javascript Component Pattern

The Sunless Citadel: A D&D 5e Session Report

Getting Started with Harp