Link
ResponseActiveThe 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).
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
| Directive | Description |
|---|---|
| rel=preload | Hint to fetch this resource early. Used with 103 Early Hints. |
| rel=canonical | The canonical URL for this content. Used in SEO. |
| rel=next | Next page in a paginated series. |
| rel=prev | Previous page in a paginated series. |
| rel=alternate | Alternate format (different language, JSON vs HTML). |
Examples
HTTP/1.1 103 Early Hints
Link: </styles/main.css>; rel=preload; as=style
Link: </scripts/app.js>; rel=preload; as=scriptHTTP/1.1 200 OK
Link: </api/users?page=3>; rel=next, </api/users?page=1>; rel=prev