ArticleslgStudy

science

Link prefetching

Link prefetching is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Link prefetching rather than just read about it. In short: Link prefetching allows web browsers to pre-load resources. This speeds up both the loading and rendering of web pages.

Key takeaways

  • Link prefetching belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Link prefetching to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Link prefetching from memory before moving on to harder problems.

Reference excerpt

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.

Prefetching in HTML5 There are two W3C standards covering prefetching for HTML5:

Link preload Hints to specific URLs. Common hints include JavaScript, CSS, images and web fonts. Resource hints 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):<link rel="dns-prefetch" href="http://example.com/"> Page pre-rendering (Google Chrome, Internet Explorer and others):<link rel="prerender" href="/page/to/prerender"> Lazy-load of images (Internet Explorer):<img src="image.jpg" lazyload> Link 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

Historical iCab, Mozilla Application Suite, 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 supports DNS prefetching, as of version 3.5. Google Chrome supports prefetching of linked web content by "prerendering", as of version 11. Internet Explorer supports prefetching of IP addresses by "DNS prefetching", as of version 9. 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 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. Specifically, Google 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 has employed the use of prefetching and preloading since the release of Internet Explorer 11 (October 2013).

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. 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 zero-day vulnerability 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 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

References

External links Mozilla Link Prefetching FAQ Test for Prefetch support Prerender and prefetch support in Internet Explorer 11 A WordPress plugin that implements the true dynamic prerender meta tag

Worked examples

Example 1 — a first encounter with Link prefetching

Start with the simplest possible case. Write down what Link prefetching claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Link prefetching before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Link prefetching ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Link prefetching

In research
Link prefetching appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Link prefetching in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Link prefetching is common in secondary-school and first-year university syllabi. It links to neighbouring topics Hypertext Transfer Protocol, so understanding it makes those chapters shorter.
In everyday life
Look for Link prefetching outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Link prefetching” →

How to study Link prefetching in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Link prefetching means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Link prefetching out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Link prefetching in simple terms?

Link prefetching allows web browsers to pre-load resources. This speeds up both the loading and rendering of web pages.

Why does Link prefetching matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Link prefetching?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Link prefetching.

Tags

  • Hypertext Transfer Protocol

Keep exploring