Powered By Blogger

Tuesday, December 2, 2014

Link prefetching

Link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might visit in the near future. A web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and stores them in its cache. When the user visits one of the prefetched documents, it can be served up quickly out of the browser's cache.

Does prefetching work with HTTPS?

Starting in Gecko 1.9.1 (Firefox 3.5), HTTPS content can be prefetched.

What are the prefetching hints?

The browser looks for either an HTML <link> or an HTTP Link: header with a relation type of either next or prefetch. An example using the link tag follows:
<link rel="prefetch" href="/images/big.jpeg">
The same prefetching hint using an HTTP Link: header:
Link: </images/big.jpeg>; rel=prefetch
The Link: header can also be specified within the HTML document itself by using a HTML meta tag:
<meta http-equiv="Link" content="</images/big.jpeg>; rel=prefetch">
The format for the Link: header is described in RFC 5988 section 5.
The browser observes all of these hints and queues up each unique request to be prefetched when the browser is idle. There can be multiple hints per page, as it might make sense to prefetch multiple documents. For example, the next document might contain several large images.
Some more examples follow:
<link rel="prefetch alternate stylesheet" title="Designed for Mozilla" href="mozspecific.css">
<link rel="next" href="2.html">



Ref link : https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ

No comments:

Post a Comment