Terminal saying Hello World
< Back
Posted on December 31, 2016

Hello World

I am very glad you have found my blog. If you want to get in touch, please refer to the infos on the front page.

If you find the contents of this site helpful, please consider a tweet or any other form of recomandation.

Cheers!

About the tech of this site

Since the reason to overhaul this site was to test out some techniques, this first post will be - suprise - about those.

I wanted to try out some performance tweaks for a while now and it never came to be while working on external projects. My main target of interest was InstantClick which “is a JavaScript library that dramatically speeds up your website”. And I have no doubt - it does! :-)

Enable the turbo mode!

Enable the turbo mode!

How it works is actually relatively simple: whenever a user hovers over a link, the linked site it prefetched, before the actual click event happens. The contents of the page are then swapped out with the fetched data. The great thing about this is that it is completely transparent, so a user who does not allow JavaScript will not even notice that something is going on.

To top this it also works out of the box with touch devices! Of course you do not have a hover action. But it seems that the delay between pressing the link and releasing the finger from the screen is enough to noticeably speed up page rendering.

So everything ponies and rainbows?

Pony with tounge… not rainbows :-(

Pony with tounge… not rainbows :-(

Well kind of. Unfortunately there are always some odds using such techniques. For example it can be a little problematic to get the page loading right. Sometimes images are not correctly loading when jumping back due to relative URL settings which lookup pictures in the wrong directory. But this is mainly due to URL resolution and should be a non-issue in dynamic environments where you set a base tag anyway. If you, like me, use a static site generator instead you will have to jump through some hoops to have the same output in development and production.

For example in my generator Hakyll I had to omit the call to the relativizeUrls function in order to get it working correctly.

All in all this is well worth the extra effort you have to put in. After all speed is a feature!

Picture reference