Lurker News
http://instantclick.io/

It seems the internet architecture won't bring us instant websites anytime soon. So here is a hack.
I released this JS library last month (today is version 2.0 release, fixing v1.0's rough edges), it makes use of HTML5's pushState and preloading to make a website instant.
It works like this: before clicking on a link, you'll hover over it. And there's a delay of 200-300 ms between these two events. InstantClick uses this delay to preload a page, when you click on a link it will display instantly in most case. (You can test on the website.)
That's similar to pjax and Turbolinks, for it uses HTML5's pushState and Ajax. And preloading is thrown into the mix.
In case preloading all the links that a user hover over is too much work for the server, there's also an option to set a delay before preloading kicks in, or to preload on "mousedown". Mousedown is when you press your mouse button (a click is when you release it). This way you still get a slight "magical" speed advantage, and pjax's benefits (notably, no recalculation of scripts/styles on every page change).
For mobile it preloads on touchstart, so you get 400 ms to preload. This is different from FastClick: with InstantClick a user can still double tap to zoom without triggering a link.
As said in the first sentence, the internet architecture can't bring us instant websites today or tomorrow. So I think this — InstantClick — could be a pretty big thing to improve the situation at scale.
The main challenge I see is that existing JS scripts may not work with it out of the box. I don't do much web development nowadays though, so I don't know how big of a problem that is, and I don't know if there isn't any other major barrier in the way to make this mainstream.
That's why I'm awaiting your opinion, smart folks of HN.

Comments (174) 47 threads

Earlier comments
udfalkso1 reply#
Very nice. It would be great if the JQuery Mobile folks would integrate this.
grobmeier#
Good idea. Pre-Loading a page when you hover a link with your finger.
kjannis1 reply#
Does this require server components? Or does it also work with a static site?
dieulot#
It just requires the 1.6kb JS file. :) So yes, it works on static websites (instantclick.io is hosted on GitHub Pages).
mbesto1 reply#
In theory you could write a chrome extension and use it for any site, right?
mbesto1 reply#
Cool, and it only works on GET responses right? So I don't have to worry about hitting "Delete" or "Save" on a web app by hovering.
dieulot#
Right. If the “delete” or “save” button isn’t a link it won’t get preloaded.
aehv2 replies#
Is it possible to make it a Chrome extension and use it on all sites?
dieulot1 reply#
I think it is possible for a subset of websites (because you can’t preload all links by default, some trigger an action such as a logout), that’s an idea I had in mind.
aehv#
I pasted the js code into a userscript.

Works great! I hope I won't have too many accidents with it.
I remember using 10 years ago a similar Windows program that preloaded all links.

Load more comments