Speeding up my blog

So last year I wanted to create a blog. I started looking around on the world wide web and found a pretty simple default solution called BlogEngine.NET. BlogEngine.NET is build on (obviously) the .NET Framework, contains both a frontend as a backend administrative part and is completely free. So I downloaded it and installed it on my Azure environment. After a few moments I was up and running and ready to write my first post.

However….

.. after a few months I noticed that the performance of my site was lacking. Sometimes when I opened a browser and navigated to ‘donheuvelman.net’ it took minutes for the frontpage to show up.
A little bit of investigation showed me that using the .NET Framework and requiring a live administration site (including authorization control etc) was the cause of all this slowlyness.
So .. time for an update to some modern lightweight alternative.

After having a conversation with some friends of mine they advised me to look at Hexo.

What the Hexo??

Hexo is a fast, simple and powerful blog Framework (I actually stole that sentence from their website) which is based on NodeJs and supports Markdown.
The fact that Hexo is not based on the .NET Framework but just plain old HTML, CSS and JavaScript made me happy so I started converting my blog from BlogEngine.NET to Hexo.io
As I already had NodeJS installed it was quite easy to install Hexo with just the following commands:

1
$ npm install hexo-cli -g

Initialize the blog folder and navigate into the blog folder.

1
2
$ hexo init blog
$ cd blog

Install all required packages automatically.

1
$ npm install

Start Hexo for the first time:

1
$ hexo server

The last command start a local server which runs the application on your localhost directory (localhost:4000)

To create a first blogpost I just simply ran the next command:

1
hexo blog new post 'TitleOfMyFirstBlogPost'

And voila.. I can now open the Markdown file; ‘titleofmyfirstblogpost.md’ in any texteditor. Modify the file and check the results directly in my preferred browser.

The result? You are looking at it! Try clicking around and notice how fast it is! Nice ha!?

The benefits

  • Faster; loading of my blog posts are almost instant,
  • Responsive website; so it also comes up pretty well on any smartphone,
  • Smaller footprint; BlogEngine used 29.2 MB on Azure where Hexo only requires a whopping 532 KB !!
  • Easier; Without too much hassle I can just create a new blogpost fast and easy,
  • Safer; No online administration so no need to create accounts or be afraid of hijacked passwords and stuff!

All in all, I’m very happy with my conversion to Hexo!

Special thanks to:

Lars Meijdam - http://larsmeijdam.nl/
Marco Franssen - http://marcofranssen.nl/

Sources:

https://hexo.io/
http://the-coderok.azurewebsites.net/2015/09/16/Running-Hexo-blog-on-Azure/