One header, many relationships
The HTTP Link header (RFC 8288) is the response-header twin of HTML’s <link>
element. It lets a server declare typed relationships — preload this, the
canonical URL is that, the next page lives here — without any markup. This
reference lists the common rel values, the target attributes they accept, and
when to reach for each.
Syntax
Each link is a URI reference in angle brackets followed by semicolon-separated
parameters. The rel parameter names the relationship; other parameters refine
it. Multiple links are comma-separated in one header line or across multiple
Link header fields:
Link: </styles.css>; rel=preload; as=style,
</app.js>; rel=modulepreload,
<https://cdn.example>; rel=preconnect
Common rel values
| rel | Purpose | Key parameters |
|---|---|---|
preload | Fetch a resource early for the current page | as, crossorigin, type |
modulepreload | Preload an ES module and its dependencies | crossorigin |
preconnect | Establish early connection to an origin | crossorigin |
dns-prefetch | Resolve DNS early for a third-party origin | — |
canonical | Declare the preferred URL for this content | — |
alternate | Point to a variant (locale, format, feed) | hreflang, type, media |
next | Identify the next document in a sequence | — |
prev | Identify the previous document | — |
stylesheet | Link a CSS stylesheet (rare in headers; normal in HTML) | media, type |
Performance relations and 103 Early Hints
Performance relations — preload, preconnect, dns-prefetch, modulepreload —
are most powerful inside a 103 Early Hints response, where the browser can act
on them before the server has finished generating the page body. A typical
server-side render that sends a 103 with preload hints for the main stylesheet
and critical JavaScript can shave hundreds of milliseconds from LCP by overlapping
resource fetch with server processing time.
Navigation and SEO relations (canonical, alternate, next, prev) work the
same in headers as in HTML, but the canonical header form is specifically useful
for non-HTML resources like PDFs and JSON endpoints where adding a <link> tag
is not possible.
Common mistakes
- Missing
asonrel=preload. Without theasattribute the browser does not know the resource type and cannot assign the right priority, CORS mode, or Accept header. The resource may still be fetched but at the wrong priority. - Missing
crossoriginon font and ES module preloads. Fonts and modules are fetched with CORS semantics. If you preload withoutcrossorigin, the browser will fetch again with CORS when the resource is actually used, resulting in a double download. - Forgetting
hreflangon alternate language links. Withouthreflang, search engines cannot identify which language variant to serve to which audience.
This reference is static and makes no network requests; nothing is uploaded or stored.