Prefetch a Resource

Description

You can ask the browser to pre-fetch a resource.

Example

The following code shows the use of the link element to specify prefetching.


<!DOCTYPE HTML>
<html>
<head>
<link rel="prefetch" href="/page2.html" />
</head>
<body>
  <p>This is a test.</p>
  <a href="http://java2s.com">Visit java2s.com</a>
  <a href="page2.html">Page 2</a>
</body>
</html>

The code above set the rel attribute to prefetch and specified that an HTML page, page2.html, be loaded in the expectation that the user will use this page.





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed