At some point during the past few months I decided that to promote myself and my abilities and possibly even make a few dollars via advertising I should start blogging about my experience with past and current projects. Keeping that in mind I set on my quest to find the proper blogging software to meet my needs.
What exactly did i want in a blogging platform?
- Easy to use.
- Hosted on my server.
- Good performance.
- Secure from hackers.
- Easy to update and customize.
Why I was initially hesitant to use WordPress
It’s slow. Not just kind of slow or a little bit slow, it’s incredibly slow. It’s slow because it’s a huge code base written in PHP. On the server-side WordPress is slow because by default PHP is parsed, interpreted, and compiled at run time. When you have thousands of lines of PHP code to compile on each page request it gets slow. I’ve never been a fan of large applications written in PHP. I’m not saying that PHP is horrible or that it doesn’t have an appropriate niche, it’s great for a contact form on a website that doesn’t see much traffic but writing a large application in a dynamically typed scripting language that is compiled on each page request will never make sense to me. I could pay for a really beefy server to try to fix the speed issue but I’m too cheap to do that.
On the Client side pages load slowly because of the large number of included style and JavaScript includes. WordPress has a history of security related bugs that have led to many sites being hacked and defaced. I would rather not have to deal with cleaning up a mess like that. Creating custom WordPress templates is not as simple as some people like to claim. Even modifying an existing template can take a non inconsequential amount of time reaching through several different include files.
What is Hugo?
Hugo is an application written in the Go programming language used to generates static websites from templates and mark down files. What I initially liked about Hugo is that it’s written in go which is a language I’ve recently been working a bit with. It was shiny and new and missing a bit of functionality but I was exited about getting to work. The template system would allow me to have complete control. I could be easily create and customize my own design. It generates static files eliminating one of the most common methods that hackers use to gain access to a site.
Nginx serving static files puts my existing server under very little load. Hugo is awesome and seemed like exactly what I needed. I got to work creating customizing my template. After that I realized that i wanted search functionality so I downloaded installed and configured OpenSearchServer. I used jQuery on my static search page to display the results from searching my open search server index. I was a bit concerned about how I would allow a second author access to my blog but I’m sure that I could figure out something when it came time to deal with that. While this was going on I still didn’t have my site up live yet. I was spending all of my free time trying to reinvent the wheel instead of writing my blog. I started looking into how some of these issues were addressed In Jekyll which is basically another static site generator but written in Ruby instead of Go. With no luck my enthusiasm was waning. I needed to get a site up.
How I ended up with WordPress.
Around this same time an acquaintance of mine that makes his living by writing and publishing an Apple related blog in France approached me about speeding up his WordPress blog. He was on a low cost shared hosting package. His site was often slow and occasionally unavailable. This led to me giving WordPress another look. I ended up moving him to a $10 a month VPS with Linode which should be more than sufficient based on his level of traffic. This is the same plan that I’m using to host this site on. On top of that came Ubuntu then came Nginx, PHP and WordPress with the WP Super Cache plugin which basically converts WordPress into a static site generator and the iThemes Security plugin to help prevent some of the common security issues. I moved the DNS over to CloudFlare.com which is providing a free version of their content delivery network. If you’re not already using them I would recommend on setting them up on every one of your sites. By the time I was finished his site was actually pretty fast. Page load times went for an average of over 11.5 seconds to an average of just under 3 seconds. I came to the realization I have other things to do than spend my time reimplementing basic blog functionality in a static site.
Hugo is pretty cool but it wasn’t the right application for my needs. WordPress is far from perfect but it works pretty well as a blogging platform and with the right combination of software, plugins and setting its inherent slowness can be overcome.