Back to the Future

By Julian Stokes | June 10, 2017

New (Old) Ways of Working

Being in the business of creating websites for other people means that it’s sometimes easy to overlook the mess in ones own back yard! It’s with this in mind that I have made use of a few spare minutes to start to put together a new site for Jewelion using some of the latest & greatest techniques.

These days it’s very easy, too easy some might say. Go out, grab a Content Management System, choose flashy looking template, add a few glitzy plug-ins and some suitable imagery, and away you go. Bob is, almost certainly, your mother’s brother. But all this flashiness and apparent ease of use comes with a price, several to be exact. Some of the prices may be worth paying. Some not. It’s all about balance.

Server Load

In the early days before Content Management Systems like Wordpress, Drupal, Joomla, Typo3 and their ilk, building a site manually used to be such fun. One of the greatest sources of fun used to be menus. Add another page to a 20 page website, chances were you’d have to edit the menus on 20 pages. Super!

Now, you don’t have to worry about that. Websites are all mostly in the database. Pages are dynamically generated, menus and relationships automatically calculated and spewed out on demand.

Here’s the thing. Every time a visitor looks at a page it’s individually generated for her. Typically a Wordpress site may generate up to 50 database queries to display a simple page. It’s true that techniques such as cacheing can get that down to around 10. For most sites, most content is relatively static. So why not do the hard work just once?

The harder a server has to work to generate a web page, the slower the site appears to the visitor. One way around that is to use a faster server or more servers. There is a cost to this, both financially and environmentally in the amount of electricity consumed.

Attack Surface

The more complicated and versatile the CMS, the more possibilities of vulnerabilities exist. Wordpress and Drupal are fine examples of well maintained and supported programs. Provided, that is, they are kept up to date with the latest patches and security fixes. That can mean reacting to and patching as soon as a notification is received. Delay, even by a few hours can mean your site becomes vandalised or even worse taken over and used to propagate viruses and malware.

As soon as you add plug-ins or modules to provide extra functionality, you are again at the mercy of the developers of such to keep their software updated and vulnerabilities fixed.

The more popular a piece of software is, the harder hackers will be working on ways of cracking it, and the more important it is to keep on top of any updates.

Static Sites Revisited

This site is created using a piece of software called Hugo. It’s as simple as one, two, three!

  1. Content is added…
  2. Hugo does his magic and generates the website…
  3. The site is uploaded.

It requires no fancy database facilities. It can be hosted on any straightforward webspace. When a change is made, or content (such as a blog post) is added a simple regeneration is all that’s required.

There are a number of different static site generators out there. Hugo is one. Another very popular generator is Jekyll. There is a learning curve, but that’s what web developers like me are for. Solutions exist to make static sites as easily as with one of the aforementioned CMS packages.

Hugo is FAST. When this site is more fully developed with more pages, I’ll update this page with a few timings as to the speed of site generation.