Skip to main content

Link

ResponseActive

The Link header is the HTTP equivalent of the HTML <link> tag. It describes relationships between the current resource and other resources using RFC 8288 Web Linking. Common uses: rel=preload (resource hints for performance), rel=canonical (SEO canonical URL), rel=next/prev (pagination), rel=alternate (different format), and 103 Early Hints (preload before main response).

Link: <uri>; rel="<relation>"[; <param>=<value>]*

Description

The Link header carries metadata about related resources. Each link entry has a URI-reference and a rel= attribute describing the relationship. Multiple links can be in a single header or across multiple Link headers. The 103 Early Hints status code uses Link: rel=preload to push hints before the 200 response, enabling browsers to start fetching CSS, fonts, and scripts before the main document arrives.

Directives

DirectiveDescription
rel=preloadHint to fetch this resource early. Used with 103 Early Hints.
rel=canonicalThe canonical URL for this content. Used in SEO.
rel=nextNext page in a paginated series.
rel=prevPrevious page in a paginated series.
rel=alternateAlternate format (different language, JSON vs HTML).

Examples

Preload hint (103 Early Hints)
http
HTTP/1.1 103 Early Hints
Link: </styles/main.css>; rel=preload; as=style
Link: </scripts/app.js>; rel=preload; as=script
Pagination
http
HTTP/1.1 200 OK
Link: </api/users?page=3>; rel=next, </api/users?page=1>; rel=prev

Related

Specification

RFC 8288Link specification →