103 Early Hints
The HTTP 103 Early Hints informational response status code allows the server to send Link headers to a client before the final response. The client uses these hints to begin prefetching resources, reducing perceived latency.
HTTP responses often contain links to external resources needed before rendering starts. 103 Early Hints gives the client a head start on loading those resources while the server prepares the final response.
Usage
When a server sends 103 Early Hints, the client interprets the Link headers and prefetches the specified resources. This is most useful when the server needs time to process the request before assembling the final response. While the server works, the client spends time loading stylesheets, images, or scripts the final page requires.
Note
Multiple 103 Early Hints responses are sent in advance of the final HTTP response.
Hints are not guarantees
In any system relying on prediction, accuracy varies. When a server returns 103 Early Hints suggesting the client fetch specific resources, the suggestion is based on a reasonable assumption. Only the final HTTP response provides authoritative Link headers.
The gap between hints and final headers manifests in two ways: the final response requires additional resources not mentioned in the hints, or resources fetched as early hints turn out to be unnecessary. In the latter case, the client performed extra work for no benefit, and total transaction time increases.
Operations performed based on early hints are safe. For example, using a GET method does not alter server state.
SEO impact
Googlebot ignores 103 Early Hints and waits for the final response. The hints provide no crawling or indexing benefit because Googlebot does not prefetch hinted resources. The status code is safe to use (103 does not interfere with how Google processes the page), but any performance gains from early hints apply only to browsers, not search engine crawlers.
Replacing server push
The 103 Early Hints mechanism is positioned to
replace the server push mechanism, as part of the
resource hints framework using rel=preload, in
modern browsers. Unlike server push,
103 Early Hints does not depend on the final
response before the browser starts fetching the
specified resources.
Note
For security purposes, browsers limit 103 Early Hints usage to HTTP/2 and HTTP/3 connections only.
Example
The client requests an index.html file, and the server returns three hints about resources likely needed. The requested file is not in the message body because the server is still generating the response. The client begins loading the resources specified by each Link directive.
After a short delay, the server returns the final 200 response, along with the official Link directives and index.html in the message body. Notice the differences between the early hints and the final resource list.
Request
GET /index.html HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 103 Early Hints
Link: </style.css>; rel=preload; as=style
Link: </images/logo.svg>; rel=preload; as=image
Link: </videos/instructions_simple.mp4>; rel=preload; as=video
<there is a short pause in the transmission>
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 100
Link: </style.css>; rel=preload; as=style
Link: </images/logo.svg>; rel=preload; as=image
Link: </images/pro_badge.svg>; rel=preload; as=image
Link: </videos/instructions_advanced.mp4>; rel=preload; as=video
<message body will follow>
The first early hint resource, style.css, is fetched and processed by the client, along with the logo image and the instructions_simple.mp4 video. Both the style sheet and the logo are usable as-is. The pro_badge image in the final response does not appear in the hints, so the client fetches this resource upon receiving the final response.
The instructions_advanced.mp4 video in the final Link headers differs from the early hint. The server suggested instructions_simple.mp4 through early hints, but the fetch was unnecessary. The newly-specified video still needs fetching and processing before index.html renders fully, likely increasing load time because two videos were fetched instead of one.
Code references
.NET
HttpStatusCode.EarlyHints
Rust
http::StatusCode::EARLY_HINTS
Rails
:early_hints
Go
http.StatusEarlyHints
Symfony
Response::HTTP_EARLY_HINTS
Python3.9+
http.HTTPStatus.EARLY_HINTS
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_EARLY_HINTS
Angular
@angular/common/http/HttpStatusCode.EarlyHints
Takeaway
The 103 Early Hints informational response status code is optional and reduces latency when loading pages. Effectiveness varies based on the predictive accuracy of the server. Clients perform safe operations and adjust for differences between hints and final headers.
See also
- RFC 8297: An HTTP Status Code for Indicating Hints
- Google: HTTP status codes and network errors
- Link
- 100
- 102
- 200
- HTTP status codes