MDN self-hosted library · e01.org

Using dns-prefetch

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<link rel="dns-prefetch" href="https://fonts.googleapis.com/" />
html
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <link rel="dns-prefetch" href="https://fonts.googleapis.com/" />
    <!-- and all other head elements -->
  </head>
  <body>
    <!-- your page content -->
  </body>
</html>
html
<link rel="preconnect" href="https://fonts.googleapis.com/" crossorigin />