WEB-41Optional
Send early hints only when they help
Send 103 Early Hints (a note sent before the answer) only for critical, safe files. Check that first paint gets faster.
How to do it
Send 103 with Link: rel=preload for critical files that don't depend on screen size. Chrome acts on it only over HTTP/2 or HTTP/3. nginx passes it on only from 1.29, with early_hints. Measure it, because hinting fonts can delay first paint. Turn on HTTP/2 or HTTP/3 first, as Serve over HTTP/2 or HTTP/3 says.
Examples
HTTP example
:status: 103
link: </rest.5d2e9b.css>; rel=preload; as=style
:status: 200
content-type: text/html; charset=utf-8
How to check
curl -v shows the 103. A lab run shows first paint earlier with the hint than without it. If it does not, remove the hint.
Measured
On a reference site (earlier lab), Early Hints could only carry fonts, which delayed paint. A hint for a responsive image couldn't be sent, because the server API rejected the spaces in imagesrcset.
Sources
Related rules
- WEB-159 Serve over HTTP/2 or HTTP/3 in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/performance/early-hints">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.