Link prefetching explained

Link prefetching allows web browsers to pre-load resources. This speeds up both the loading and rendering of web pages. Prefetching was first introduced in HTML5.

Prefetching is accomplished through hints in web pages. These hints are used by the browser to prefetch links. Resources which can be prefetched include: JavaScript, CSS, image, audio, video, and web fonts. DNS names and TCP connections can also be hinted for prefetching. [1] [2]

Prefetching in HTML5

There are two W3C standards covering prefetching for HTML5:

HTML5 methods for prefetch hints:

Link: <//pagead2.googlesyndication.com>; rel=dns-prefetch,
      </js/bootstrap.min.js>; as=script; rel=preload,
      </ads.html>; rel=prerender,
      </css/bootstrap.min.css>; as=style; rel=preload

Browser support

BrowserPrefetching Supported
Standard link prefetchingDNS prefetchingPrerenderingLazy-load (Images)
Android browser[5]
Chromium
Google Chrome
Internet Explorer[6]
Mozilla Firefox[7]
Opera
Safari

Historical

Modern browsers

Popular sites using prefetching

Issues and criticisms

An issue inherent to indiscriminate link prefetching involves the misuse of "safe" HTTP methods. The HTTP GET and HEAD requests are said to be "safe", i.e., a user agent that issues one of these requests should expect that the request results in no change on the recipient server.[13] However, it is common for website operators to use these requests outside of this constraint. Plain hyperlinks (which almost universally result in GET requests) are often used to implement logout functionality and account verification, e.g., when a user completes an account creation form, and an automated service sends a verification e-mail to the user's given e-mail address.

Similarly, it is entirely possible for a hosting service to provide a Web front end to manage files, including links that delete one or more files. Users who visit pages containing these types of links, (whilst using a browser which employs an indiscriminate link prefetcher), might find that they have been logged out or that their files have been deleted.[14]

Additionally, there are a number of criticisms regarding the privacy and resource usage implications of link prefetching:

In the case of mobile devices or for users with a limited bandwidth allowance, prefetching may result in an unnecessary costly drain on limited bandwidth.

It is possible for implementations to prefetch links even when they are not specified as prefetch links.

In the case of prerendering, Google warns that improper use may result in the aforementioned increased bandwidth usage, slower loading of other links, and slightly stale content.

See also

External links

Notes and References

  1. Web site: Preload. w3c.github.io. 2016-03-19.
  2. Web site: Resource Hints. w3c.github.io. 2016-03-19.
  3. Web Linking. RFC 5988. 2010 . IETF. 10.17487/RFC5988 . 2016-03-19. Nottingham . M. . 367264 . free.
  4. Web site: Resource Hints (Example 6). Resource Hints: W3C Working Draft. W3C. 2016-10-31.
  5. Web site: Prebrowsing . 2013-10-07 . Steve Souders.
  6. Web site: Getting to the Content You Want, Faster in IE11 . dead . https://web.archive.org/web/20140512221226/http://blogs.msdn.com/b/ie/archive/2013/12/04/getting-to-the-content-you-want-faster-in-ie11.aspx?Redirected=true . 2014-05-12 . 2013-12-04 . IEBlog, Microsoft.
  7. Web site: Bug 730101 - Implement prerendering in Firefox . 2014-10-18 . Mozilla.
  8. Web site: Link Prefetching in Mozilla: A Server-Driven Approach . Fisher . Darin . Saksena . Gagan . 2014-05-09.
  9. Web site: Controlling DNS prefetching . 2014-05-09.
  10. Web site: Web Developer's Guide to Prerendering in Chrome . 2014-05-09.
  11. Web site: Internet Explorer 9 Network Performance Improvements . 2014-05-09.
  12. Web site: About Google Instant . 2014-05-09.
  13. Hypertext Transfer Protocol—HTTP/1.1 . 2616 . Safe Methods . 9.1.1 . 50 . Roy . Fielding . Roy Fielding . Jim . Gettys . Jim Gettys . Jeffrey . Mogul . Henrik . Frystyk . Henrik Frystyk Nielsen . Larry . Masinter . Paul . Leach . Tim . Berners-Lee . Tim Berners-Lee . Network Working Group . June 1999 . . 2009-12-16.
  14. Web site: various . Mouseover Prefetch? . . 2009 . 2009-12-16 . 2009-05-31 . https://web.archive.org/web/20090531005531/http://weblogs.mozillazine.org/gerv/archives/2009/05/mouseover_prefetch.html . dead .