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

Show all comments

Showing thread 24 of 47

lifeformed1 reply#
Is there a demo page? I want to see what it feels like.
dieulot3 replies#
The website it is.
yogo1 reply#
Good stuff, but I don't think this website is big enough to demo the benefits, maybe a heavier website is needed. A properly configured web server as well as the right HTTP headers will give you the same speed, perceptually.

Also you might want add some kind of tracking to avoid making repeat requests (probably within a timeframe). For e.g. hovering one link, then changing your mind, then going to another link. The browser will smartly pull it from its cache but this lib is still making the requests.

mooreds1 reply#
I just added it to my database driven website that is run off shared hosting: http://coloradocsas.info/

It doesn't feel that much faster, but I'd love a way to verify speed changes with data.

jwcrux1 reply#
I'm watching via the dev console and don't see any requests being sent out on hover. Are you sure it's working?
mooreds1 reply#
I took another look and I wasn't doing the init(). I am now, but it still doesn't appear to be working. Not sure why.

Continue this thread — 1 reply

aabalkan#
Wow cool!
tripzilch#
I figured as much, but please add an additional demo part to your website, something like 10 interlinking Lorem ipsum pages. Be sure to also add a few images on some pages (but not on others).

I had already viewed a couple pages (to read what it is about) before I started looking for a demo, and by then I wasn't sure if it was my browser caching or your script that made the pages load snappy.
Maybe also provide a 10-page Lorem ipsum "before" example, clearly marked that it does not use your library, to demonstrate the difference. I can't really tell if maybe your server is just really fast.