Learn Performance - Resource Hints

HTTP headers

Resource hints may also be sent in the HTTP response headers using the Link header. This works similarly to placing the <link> in the markup.

This demo includes a Link, <https://cdn.glitch.global>; rel=preconnect; response header.

WebPageTest waterfall chart showing seven resources. The connection for the fourth resource, image-1.jpg is opened before the image is discovered and requested.

Similarly to the preconnect example, the connection for the first image resource, image-1.jpg is opened before the image is discovered.

View Source Code
// server.js
reply.header("Link", "<https://cdn.glitch.global>; rel=preconnect;");