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
HTML5 (Hypertext Markup Language 5) is a markup language used for structuring and presenting hypertext documents on the World Wide Web. It was the fifth and final major HTML version that is now a retired World Wide Web Consortium (W3C) recommend ...
.
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
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
web fonts
Web typography, like typography generally, is the design of pages their layout and typeface choices. Unlike traditional print-based typography (where the page is fixed once typeset), pages intended for display on the World Wide Web have additional ...
. DNS names and TCP connections can also be hinted for prefetching.
Prefetching in HTML5
There are two W3C standards covering prefetching for HTML5:
* Link preload
** Hints to specific URLs. Common hints include
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
web fonts
Web typography, like typography generally, is the design of pages their layout and typeface choices. Unlike traditional print-based typography (where the page is fixed once typeset), pages intended for display on the World Wide Web have additional ...
.
* Resource hints
** Hints to the browser. Common hints include DNS queries, opening TCP connections, and page pre-rendering.
HTML5
HTML5 (Hypertext Markup Language 5) is a markup language used for structuring and presenting hypertext documents on the World Wide Web. It was the fifth and final major HTML version that is now a retired World Wide Web Consortium (W3C) recommend ...
methods for prefetch hints:
* Standard link prefetch (supported by most browsers):
* DNS prefetch (
Mozilla Firefox
Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curren ...
,
Google Chrome
Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
, and others):
* Page pre-rendering (
Google Chrome
Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
,
Internet Explorer
Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated as IE or MSIE) is a deprecation, retired series of graphical user interface, graphical web browsers developed by Microsoft that were u ...
and others):
* Lazy-load of images (
Internet Explorer
Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated as IE or MSIE) is a deprecation, retired series of graphical user interface, graphical web browsers developed by Microsoft that were u ...
Mozilla Application Suite
The Mozilla Application Suite (originally known as Mozilla, marketed as the Mozilla Suite) is a discontinued cross-platform integrated Internet suite. Its development was initiated by Netscape Communications Corporation, before their acquisition ...
, and WebTV are the first referenced browsers to support link prefetching.
*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
Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curren ...
supports DNS prefetching, as of version 3.5.
*
Google Chrome
Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
supports prefetching of linked web content by "prerendering", as of version11.
*
Internet Explorer
Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated as IE or MSIE) is a deprecation, retired series of graphical user interface, graphical web browsers developed by Microsoft that were u ...
supports prefetching of IP addresses by " DNS prefetching", as of version9.
**As of version 11, Internet Explorer supports the following set of features to expand its prefetching capabilities: "prerender", "dns-prefetch" and "lazyload" (images only).
Popular sites using prefetching
*
Google
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
is the most well-known
website
A website (also written as a web site) is any web page whose content is identified by a common domain name and is published on at least one web server. Websites are typically dedicated to a particular topic or purpose, such as news, educatio ...
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.
**Specifically,
Google
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
implemented "Google Instant Pages" in August 2011 which takes advantage of the aforementioned feature, predictive search completion, and preloading search results as the user types in order to improve the performance of the search engine.
*
Bing
Bing most often refers to:
* Bing Crosby (1903–1977), American singer
* Microsoft Bing, a web search engine
Bing may also refer to:
Food and drink
* Bing (bread), a Chinese flatbread
* Bing (soft drink), a UK brand
* Bing cherry, a varie ...
has employed the use of prefetching and preloading since the release of
Internet Explorer 11
Internet Explorer 11 (IE11) is the eleventh and final version of the Internet Explorer web browser, by now retired. It was initially included in the release of Windows 8.1, Windows RT, Windows RT 8.1 and Windows Server 2012 R2 on October 17, 2013 ...
(October 2013).
Issues and criticisms
An issue inherent to indiscriminate link prefetching involves the misuse of "safe" HTTP methods. The HTTP GET and
HEAD
A head is the part of an organism which usually includes the ears, brain, forehead, cheeks, chin, eyes, nose, and mouth, each of which aid in various sensory functions such as sight, hearing, smell, and taste. Some very simple ani ...
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. 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.
Additionally, there are a number of criticisms regarding the privacy and resource usage implications of link prefetching:
* Cookies set or sent to third parties compromise Web privacy.
* Enables essentially/borderline Zero-click attack malware installation via 0day merely because a malware-spreading link is prefetched.
* Users and website operators who pay for the amount of bandwidth they use find themselves paying for traffic for pages the user might not actually visit, and advertisers might pay for viewed ads on sites that are never visited.
* Web statistics such as browser usage, search engine referrers, and page hits may become less reliable due to registering page hits that were never seen by the user.
* Users may be exposed to more security risks by downloading more pages, or from un-requested sites (additionally compounded as drive-by downloads become more advanced and diverse).
* Users may violate acceptable-use policies of their network or organization if prefetching accesses unauthorized content.
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
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
warns that improper use may result in the aforementioned increased bandwidth usage, slower loading of other links, and slightly stale content.
See also
*
Cache prefetching
Cache prefetching is a technique used by computer processors to boost execution performance by fetching instructions or data from their original storage in slower memory to a faster local memory before it is actually needed (hence the term 'prefetc ...