This weekend I saw someone link Instant.Page – a small javascript library that prefetches links before you click on them. I’ve seen similar projects before that used Ajax to load the html and then substitute a container with the new content. A nice idea, but things like javascript & Google Analytics stop working since a new page load doesn’t happen.
Instant.Page fixes this. It uses web browsers built in prefetching capabilities to load the html before you click the link. So I made a really simple plugin and added it to my website. I then sent out a single tweet, and got an immediate response that my site seemed fast; even on mobile.
Instant.Page uses both touch and hover events, and just those few milliseconds of extra time make your website appear to be a lot faster and more responsive.
And a more responsive website means people are more likely to hang around longer, and an increase in conversions.
So I submitted Tada to the WordPress repository, and then I contacted the scripts author and told him I was doing it. Besides asking me not to call the plugin Instant.Page (which I had done originally…), he also pointed out there was another plugin that does the same thing. It’s largely the same as mine, but it has an options panel.
I had tried looking for plugins before submitting my version but found nothing – and personally I feel my version is better. I guess the options could be useful in some situations, but I have yet to work out what those situations are. For me, the added overhead of storing settings in a database just isn’t worth it.
My plugin is super simple. Including comments it’s only 50 lines of code, and I write verbose comments. Without comments it’s about 8 lines. I basically just enqueue the script. I want my sites to be fast, and the best way to do this is to keep things as simple as possible.
I think it’s a nice little add-on and would be happy to get any feedback on it. Thanks to Mika for publishing Tada so quickly, and for helping me sort out the naming issue; in particular since it all happened over the weekend
Was it good/ useful/ a load of old rubbish? Let me know on Mastodon, or BlueSky (or Twitter X if you must).
Link to this page
Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.