-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
Describe the feature you'd like to add to nginx
Support for the 103 Early Hints HTTP status code in Nginx. Early Hints allows sending preliminary HTTP headers to the browser before the final response is fully generated, enabling browsers to start loading critical resources earlier. This feature would significantly improve the performance of websites by allowing the browser to initiate requests for CSS, JavaScript, and other assets before the entire HTML document is delivered.
Describe the problem this feature solves
This feature solves the problem of delayed loading of critical resources on the web. Currently, browsers wait for the full HTML response before they can request resources like CSS or JavaScript files. Early Hints allows the server to "hint" to the browser which assets it should start fetching before the full response is ready. This can reduce Total Page Load Time and enhance perceived performance for users by optimizing resource delivery.
Additional context
Cloudflare has documented their experience with Early Hints and its performance benefits in production use. According to Cloudflare's blog, Early Hints can reduce load times by allowing resources to be fetched and processed sooner, thus speeding up rendering and improving user experience. By adding Early Hints support to Nginx, this widely-used server would gain a feature that is becoming essential for web performance optimizations in modern web development.
There is an experimental module, but it is 8 years old and not adapted to current versions of nginx: https://github.com/nginx-modules/ngx_http_early_hints