Karthik Hariharan

Reflections on Software

A Fresh Start on a Static Site

I’ve decided to move my blog to a new domain and use a static site generator to serve up the content. Since the content doesn’t change much, it makes little sense to continue using Wordpress on a shared web hosting plan with limited resources.

Static Sites Are Fast

A static site significantly reduces the overhead of disk I/O by taking the relational database out of the picture. Most modern web servers can be highly tuned to avoid disk access for static content by utilizing output caching. If setup correctly, the fast majority of web requests require zero disk I/O. This allows the web server to serve content faster and handle larger loads with less resources.

While it is possible to use Wordpress Plugins like SuperCache to reduce disk I/O, it still requires a Fast CGI process to serve the content via PHP. This incurs enough CPU usage to make it slower than a pure static site.

Easy cloud based hosting and scaling

While a typical shared hosting setup works most of the time, it does carry the possibility of a popular post bringing your hosting to its knees. Planning for this kind of event carries a lot of cost which will go unused most of the time.

Cloud based hosting platforms, like Heroku, are perfectly suited for hosting static sites that can be scaled up very easily. Heroku’s free plan goes a long way and would likely handle the vast majority of traffic, but still give you the ability to use push button scaling for those rare instances when a post hits the #1 page of Hacker News.

Choosing a static site generator

There a number of static site generators that will perform the basic operations of translating posts that are written in Markdowninto HTML and organizing the output along with any uploaded media.

I chose to go with Octopress because it offered the following:

  • Ruby based and easily customizable with plugins.
  • Easily configured to work with Heroku.
  • Stylesheets are written in Sass.
  • Excellent typography out of the box with the base theme.
  • Sits on top of Jekyll, and can utilize many existing plugins.
  • Easy local preview with a built in Rack server.

Migrating old content

I’ve chosen to move my old wordpress install over to wordpress.com’s free plan for archival purposes rather than attempt a content migration. But if you want to preserve your old content and links, there is a Wordpress to Jekyll migrating tool called ExitWP that many have used successfully. Also, you can utilize a rack server to execute code to handle redirects.

Additional Resources

Comments