Reputation: 1995
In case of a clear probable direction of where the user will go (for example image gallery or similar) one may not only guess where the user will go after his next click, one may predict the next 5 clicks or more.
When one uses "prerender"-links (or "prefetch" for browsers that don't understand "prerender") to multiple pages, the browser will download and render all these links, but will it forget the data after the user has clicked on a link, and how long stays the prefetched/prerendered version usable? Is there any clear documentation on that feature?
In other words: Would a "prerender"-link to the next 5 pages make the website faster (because the user can skip a page quickly) or slower (because the browser needlessly prerenders 5 pages on every click)?
Edit: I have now made some tests and it seems as if multiple prerender-links doesn't make it faster if you just put in prerender links.
Upvotes: 3
Views: 1771
Reputation: 6606
Nice Question, First we need to make it clear that "prerender" and "prefetch" are two different features with many different limitations and behavior. One of the big issues here are that they will both act slightly different depending on the webrowser and they are often misunderstood and misused.
prefetch The concept of prefetching is included in the HTML5 spec better used for loading resources (stylesheets,js,pictures etc) - that's because it loads into the cache as a subresource. When prefetching a page the browser downloads (once the current page is fully loaded) the top layer of the page that is linked (Iframes in the target page won't be prefetched). Prefetching an entire page may cause lack of performance. what's cool about prefetching is that the limits are way higher - Prefetching Process is per tab (not webbrowser instance), And you can set Many links for Prefetching (IE < 9 - Max 10 Links, Mozilla unknown).
prerender First Presented By Chrome and implemented by IE11 Later - when added to a page it will execute a page full loading process (on a hidden tab) of the linked page at the background - You can see it firing (once the main page is loaded) by looking at the Task manager (Chrome).
One of the big issues here are that a prerender process
is per instance of a browser (not per tabs open) that mean that in case another site is already opened and fired this process yours may be ignored OR delayed (it depends which browser).
Another interesting fact is that you can add only one "prerender" Link per page, if you add more they will be ignored - and if you are loading the prerender link dynamically you need to know there is an interval restrict issue (500ms - in Chrome).
Prerendering extends the concept of prefetching. Instead of just downloading the top-level resource, it does all of the work necessary to show the page to the user—without actually showing it until the user clicks. Prerendering behaves similarly to if a user middle-clicked on a link on a page (opening it in a background tab) and then later switched to that tab. However, in prerendering, that “background tab” is totally hidden from the user, and when the user clicks, its contents are seamlessly swapped into the same tab the user was viewing. From the user’s perspective, the page simply loads much faster than before.
HTTP Link: header - <meta http-equiv="Link" content="</images/big.jpeg>; rel=prefetch">
Upvotes: 12