Static versus Dynamic websites

Gwilym :: September 26th, 2018
Static versus Dynamic websites

In my daily work I have been constructing websites for (really?) over twenty years. It started with static html, went to PHP2, then to content management systems like Joomla, Magento, Prestashop, Wordpress, Concrete5 and frameworks like Cake and Laravel PHP, then onto raw Jquery and now API backed React apps.

Lately when building brochure-ware sites that do not require much in the way of database interactivity I've been using - a static site generator for sites that historically I would have used Wordpress. I've been loving it and finding it very productive.

Before I list the pros and cons of building static sites what does it mean exactly? A static site is one that requires no smarts on the server other than sending the page and no code is running on the server each time the page is made up. On contrast Wordpress runs PHP code every time a request is made and invariably hits the database. You can imagine a static site is much, much faster for a web server to deliver and also much more reliable as there are few layers operating.

Pros of building static web sites:

  1. Nice and easy to roll a custom template with the CSS and JS libraries you require for a specific project without bloat. This site uses Tailwind CSS, others I've made recently use Bootstrap 4 and custom SCSS.

  2. Component lead structure makes it nice and easy to build up discreet bits and pieces

  3. Easy to deploy, no preprocessor needed (PHP, ASP etc). Web hosting is a breeze.

  4. Oh so FAST for the customers, the people using the site. Loading times are just BAM.

And the cons:

  1. No CMS features for clients to create/edit content. This can be an issue but to be honest most clients I have built Wordpress sites for never login anyway and get me to make changes, so in that case Jekyll would be just as fast if not faster. There are some interesting online systems that will enable this for Jekyll sites but I haven't tried any of them yet.

  2. You need to know HTML/CSS et al, it's not just point and click. Ah well .... it is quite fun .... so get into it :-)

Breaking news!

While looking round for a good way to integrate, a utility first CSS framework, into Jekyll I happened across some articles on I've been working with React a lot lately and I figured I'd give it a go, Gatsby is what this website is made with.