I wrote a post 3 months ago about pre-fetching links to improve performance. This post talked about a library called instant.page, which is a free and open source library that uses just-in-time preloading, meaning it preloads a page right before a user clicks on it. Pages are preloaded only when there’s a good chance that a user will visit them, and only the HTML is preloaded, being respectful of your users’ and servers’ bandwidth and CPU. It uses passive event listeners so that your pages stay smooth and doesn’t preload when the user has data saver enabled.
I’ve been installing the WordPress plugin on pretty much all the sites that I manage (contact me if you’re interested in adding your site to that list!) where speed is more important than accurate analytics. But as I’m also a big Cloudflare fan, I thought there may be another way.
Introducing Cloudflare Apps. These are apps built in javascript which run on the Cloudflare edge nodes (180+ around the world and increasing) – they can easily be switched on and configured form within the Cloudflare dashboard and can be used to add all sorts of functionality, such as live chat clients, social sharing buttons, etc.
So I decided to create my very own Cloudflare app; Instant Page. This app simply takes the instant.page library as is and adds it into your website – no configuration options needed, just enable the app.
It was a simple process, but then I was creating a very simple app. I’m looking forward to creating more in the future, and possibly putting together a course on how it’s done too.