3 ms·
So, after scanning through the linked resources at the bottom of the article, it seems as though the `prefetch` and `prerender ` link relations are two differen
by darrhiggs 13y ago
So, after scanning through the linked resources at the bottom of the article, it seems as though the `prefetch` and `prerender ` link relations are two different things.
The `prefetch` link relation[1] is registered with IANA, and is part of the HTML5 spec. Its use seems to be to prefetch & cache one asset for subsequent browser rendering.
The `prerender` link relation will tell the browser (chrome) to prefetch & cache an asset and all linked assets required for its rendering.
They seem like they both have a use but only one is part of the HTML5 spec, and it seems that prefetch was only ever implemented in firefox.
I know that Google wants a speedy experience for its users (more users), and it has pushed hard before with things like SPDY, but why not add to the spec rather than fragment?
[1] http://www.w3.org/TR/html5/links.html#link-type-prefetch http://www.w3.org/TR/html5/links.html#link-type-prefetch
- nobodysfool 13y agoI've tried it and it sort of works, I've had it on some of my sites for a while now. One thing that it doesn't seem to handle is the 'search results prefetching'. I have a dynamic table, and when a person types in their search terms, the table will filter, and if filtering results in 4 or less rows in the table, i'll add a prefetch to each of those links. However, what chrome does is start the request and then immediately cancel it. So the server's cache is warmed up, but the client still has to request the page. So, Chrome supports prefetch but it seems to cancel the request immediately (you can see this with the network monitoring tool of chrome). Anyway, here's their take on it, and it makes a lot of sense. https://developers.google.com/chrome/whitepapers/prerender https://developers.google.com/chrome/whitepapers/prerender
- acdha 13y ago[As per the HTML5 spec](http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#other-link-types http://www.whatwg.org/specs/web-apps/current-work/multipage/...) new values are proprosed in the microformats wiki: http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions http://microformats.org/wiki/existing-rel-values#HTML5_link_... You'll note that ``prerender`` is there as well as the ``subresource`` link relation which is a stronger form of ``prefetch`` stating that the resource will be used by the current page rather than likely to be used on subsequent pages. I did some benchmarks to compare the performance of each variation across the top three browsers: http://chris.improbable.org/experiments/browser/prefetch-timing.html http://chris.improbable.org/experiments/browser/prefetch-tim...
- darrhiggs 13y agoThanks for the links. I tend to use link relations for APIs; I hadn't realised that the HTML5 spec linked to a different registry.
- deleted 13y ago[deleted]
- igrigorik 13y agoA comparison of the different hints, and which browsers support them: http://chimera.labs.oreilly.com/books/1230000000545/ch10.html#BROWSER_OPTIMIZATION http://chimera.labs.oreilly.com/books/1230000000545/ch10.htm...