Skip to main content
JC

Turbolinks

Single Page Routing is cool, because it allows your pages to load without incurring the cost a full load. It can be difficult to set up, but I would recommend checking out Turbolinks. You can Single Page Routing running on your existing site in like, twenty minutes. It’s great.

It’s a tiny little script that you just have to insert into your <head>, and it swaps out the body whenever you follow a link. It prevents your CSS and JS from being redownloaded, so you don’t get an unsightly white flash when your page loads.

This site is already pretty fast, as it uses Hexo to render the site out statically, but I still added Turbolinks, and now it’s even faster.

The process was also pretty simple for this site:

And I think that’s it. It’s really great for sites that don’t use a lot of JavaScript.

https://github.com/turbolinks/turbolinks