Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another idea: take into account the movement of the mouse to define a directional cone in the general direction of the movement, which would enable you to preload your pages even before the hover state occurs.


Amazon have done this to improve the performance of dropdown menu. http://bjk5.com/post/44698559168/breaking-down-amazons-mega-...


This article was really eye opening when I read it a few months ago.

I've always hated menu dropdowns where it would close if you try to skip to the next submenu you've opened, since you hovered on the other parts on your way to the submenu.

So you'd end up having to perfectly 'trace' the menu so it won't close down on you.


That article says nothing about preloading pages. The speed gains are purely a UI thing -- if you're clever about keeping submenus open even when the mouse leaves the submenu's entry in the main menu, you don't need to provide a delay for menu opening/closing.


I think the Amazon example was being used as an example of the "directional cone", not preloading.


A few years ago, I went to a tech demo/hackathon thing. Somebody had some neat experiments with preloading pages speculatively based on user behaviour

The coolest approach given was when a user types in the search box, kick off the request for the full results page if they move their mouse on a motion curve towards one of the results, with some machine learned data on how people move their mouse: Not quite in a straight line, and with some acceleration.


Kinda overkill. ;) I may explore this idea later, but I don’t have great hope for it.


It is overkill, you're absolutely right about that. But that's the good thing about the webs, you can throw the stupidest ideas on the table and the let everyone flesh it out :D


Most times there are some few links that are very frequently clicked on; for example in Hacker News is usually the "next page" and the "threads". So if there is not one already there should be a way to specify some (obligatory?) preload pages.


I think you should utilize the prefetch behavior of the link tag for situations such as these. No need for JavaScript at all.


Could you elaborate this, please.


    <link rel="prefetch" href="http://example.com/page2" />
More info at http://davidwalsh.name/html5-prefetch


In my opinion even that is overkill. Remember, in most cases it’s already instant. The return on investment (speed/requests) abruptly declines with brute preloading.


Weird I thought about this last night and wondered if browser pruned the dom/layers based on input device deltas.


I believe I read somewhere that Amazon does this for their menus. Clever idea to utilize this kind of analysis though.

edit: @devgutt else already mentioned this. I had this page open for a while before posting.


Or just load every page. ;)


That might not be very nice for some mobile users that are on a site with a ton of links (like a news site) :)


There is no hover for mobile. Maybe track eye focus in future :-)


It's a continuation of a joke with the parent comment regarding loading every page. It would be the brute force version of InstantClick :)


Not a bad shout. Not EVERY page, but if you have a five page site, you might as well pull in all five at the time, and save the other four requests later.

The actual HTML is only going to add another few KB.


I'm sorry that I don't feel it very efficient, because sites with dynamic contents like HK or eCommerce/financial sites, very page is different from minute to minute.

But caching the skeleton of the page will work. We need browser to do it for us, just like browsers already caches the images.


Or the pages that are most likely to be requested, based on previous session data which you have stored and analyzed.


Another idea: preload all links of every page.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: