Link
HTTP の Link
エンティティヘッダーフィールドは、 HTTP ヘッダー内の1つ以上のリンクをシリアル化する手段を提供します。意味的には、 HTML の <link> 要素と同等です。
Syntax
Link: < uri-reference >; param1=value1; param2="value2"
<uri-reference>
- URI 参照。
<
と>
で囲む必要があります。
Parameters
リンクヘッダーには ;
で区切られたパラメーターが含まれており、 <link>
要素の属性に相当します。
例
URI は <
と >
で囲む必要があります。
Link: <https://example.com>; rel="preconnect"
Link: https://bad.example; rel="preconnect"
複数リンクを指定
カンマで区切られた複数のリンクを指定できます。次に例を示します。
Link: <https://one.example.com>; rel="preconnect", <https://two.example.com>; rel="preconnect", <https://three.example.com>; rel="preconnect"
仕様書
仕様書 | 題名 | 備考 |
---|---|---|
RFC 8288, セクション 3: Link Serialisation in HTTP Headers | IETF RFC | |
RFC 5988, セクション 5: The Link Header Field | IETF RFC | 初回定義 |