<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>rel=preload Example Source</title>
        <!-- Preload the web font file so it can be used sooner when needed -->
        <link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin="anonymous">
        <!-- Link the stylesheet that includes the web font styles -->
        <link rel="stylesheet" href="webfont.css">
    </head>
    <body>
        <!-- Allow the preloaded web font to be applied quickly to the text -->
        <h1>rel=preload Example Source</h1>
        <!-- Additional content -->
    </body>
</html>
<link rel="preload" href="resource path" as="resource type" [additional attributes]>
<!-- as="font" -->
<link 
    rel="preload"
    href="font.woff2"
    as="font">

<!-- as="image" -->
<link 
    rel="preload"
    href="sample-image.png"
    as="image">

<!-- as="style" -->
<link 
    rel="preload"
    href="sample-style.css"
    as="style">

<!-- as="script" -->
<link 
    rel="preload"
    href="sample-script.js"
    as="script">

<!-- as="fetch" -->
<link 
    rel="preload"
    href="sample-fetch.json"
    as="fetch">
<link
    rel="preload"
    href="font.woff2"
    as="font"
    type="font/woff2"
    crossorigin="anonymous">
<link
    rel="preload"
    as="image"
    href="mobile.png"
    media="(max-width: 600px)">
<link
    rel="preload"
    as="image"
    href="desktop.png"
    media="(min-width: 601px)">