Link prefetching
Appearance
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:
- Link preload[1]
- Hints to specific URLs. Common hints include JavaScript, CSS, images and web fonts.
- Resource hints[2]
- Hints to the browser. Common hints include DNS queries, opening TCP connections, and page pre-rendering.
HTML5 methods for prefetch hints:
- Standard link prefetch (supported by most browsers):
<link rel="prefetch" href="http://www.example.com/">
- DNS prefetch (Mozilla Firefox, Google Chrome, and others)[citation needed]:
<link rel="dns-prefetch" href="http://example.com/">
- Page pre-rendering (Google Chrome, Internet Explorer and others)[citation needed]:
<link rel="prerender" href="/page/to/prerender">
- Lazy-load of images (Internet Explorer)[citation needed]:
<img src="image.jpg" lazyload>
Link
[3][4] for HTTP headers: Example below.
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
Browser | Prefetching Supported | |||
---|---|---|---|---|
Standard link prefetching | DNS prefetching | Prerendering | Lazy-load (Images) | |
Android browser | Yes[5] | No[5] | No[5] | No |
Chromium | Yes[5] | Yes[5] | Yes[5] | No |
Google Chrome | Yes[5] | Yes[5] | Yes[5] | No |
Internet Explorer | Yes[6] | Yes[6] | Yes[6] | Yes[6] |
Mozilla Firefox | Yes[5] | Yes[5] | No[7] | No |
Opera | Yes[5] | No[5] | No[5] | No |
Safari | No[5] | Yes[5] | No[5] | No |
Historical
- iCab, Mozilla Application Suite, and WebTV are the first referenced browsers to support link prefetching.[8]
- Browsing using a Google Web Accelerator (discontinued product, may technically be called precaching)
- The Blue Coat proxy appliance is known to use non‑compliant prefetching.
Modern browsers
- Mozilla Firefox supports DNS prefetching, as of version 3.5.[9]
- Google Chrome supports prefetching of linked web content by "prerendering", as of version 11.[10]
- Internet Explorer supports prefetching of IP addresses by "DNS prefetching", as of version 9.[11]
- As of version 11, Internet Explorer supports the following set of features to expand its prefetching capabilities: "prerender", "dns-prefetch" and "lazyload" (images only).[6]
Popular sites using prefetching
- Google is the most well-known website that takes advantage of this feature so as to improve the user experience. If the first hit is considered very probable to be the desired hit, it is assigned as a prefetchable link.
- Bing has employed the use of prefetching and preloading since the release of Internet Explorer 11 (October 2013).[6]
==
See also
References
- ^ a b "Preload". w3c.github.io. Retrieved 2016-03-19.
- ^ a b "Resource Hints". w3c.github.io. Retrieved 2016-03-19.
- ^ "Web Linking". RFC 5988. IETF. Retrieved 2016-03-19.
- ^ "Resource Hints (Example 6)". Resource Hints: W3C Working Draft. W3C. Retrieved 2016-10-31.
- ^ a b c d e f g h i j k l m n o p q "Prebrowsing". Steve Souders. 2013-10-07.
- ^ a b c d e f "Getting to the Content You Want, Faster in IE11". IEBlog, Microsoft. 2013-12-04. Archived from the original on 2014-05-12.
- ^ "Bug 730101 - Implement prerendering in Firefox". Mozilla. 2014-10-18.
- ^ Fisher, Darin; Saksena, Gagan. "Link Prefetching in Mozilla: A Server-Driven Approach" (PDF). Retrieved 2014-05-09.
- ^ "Controlling DNS prefetching". Retrieved 2014-05-09.
- ^ "Web Developer's Guide to Prerendering in Chrome". Retrieved 2014-05-09.
- ^ "Internet Explorer 9 Network Performance Improvements". Retrieved 2014-05-09.
- ^ "About Google Instant". Retrieved 2014-05-09.