Early Hints is a status code (103) introduced in HTTP/2 and further utilised in HTTP/3 protocols. It allows a server to send response headers before the final response. This early response aims to improve web loading times by allowing clients (browsers) to preload necessary resources like CSS, JavaScript files, or images while waiting for the server to prepare the full response.
Early Hints
How do Early Hints work?
When a web server receives a request, it can immediately send a 103 Early Hints response containing Link headers for resources it knows the client will need. These headers suggest to the client which resources to preload. Following this, the server continues processing the request and eventually sends the final response code (e.g., 200 OK) along with the requested content.
The browser can then spend the time waiting for the final response from the server preloading and parsing assets, significantly improving the user experience and core web vitals.
What about HTTP/2 Server Push
Early hints as significant advantages over the HTTP/2 Server Push feature which has fallen out of favour. Early Hints can occur before the final response and the browser can inspect its internal cache to decide whether it needs to download the hinted resource or not.