HTTP Link Header Reference

All Link header relation types with rel values, target attributes and use cases.

Searchable HTTP Link header reference covering rel=preload, canonical, alternate, next, prev, modulepreload and IANA link relations with target attributes like as, crossorigin and type.

What is the HTTP Link header?

Defined by RFC 8288 (Web Linking), the Link header expresses typed relationships between the current resource and other URIs, mirroring the HTML link element but in the response header. Each link is a URI in angle brackets followed by parameters like rel and type.

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.

How it works

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:

Link: </styles.css>; rel=preload; as=style,
      </app.js>; rel=modulepreload,
      <https://cdn.example>; rel=preconnect

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 page body even exists. Navigation and SEO relations (canonical, alternate, next, prev) describe document structure.

Tips and notes

  • as is mandatory for rel=preload; without it the browser cannot prioritise.
  • Add crossorigin when preloading fonts or any CORS resource, or it re-fetches.
  • rel=canonical in a header is honoured for non-HTML resources like PDFs.
  • Use hreflang and type on alternate to point at localised or feed variants.