💡
103
Early Hints
Example HTTP Response
HTTP Response
HTTP/1.1 103 Early Hints
Link: </style.css>; rel=preload; as=styleCommon Causes
- Preloading resources while server prepares response
- Sending Link headers early for faster page loads
- Optimizing perceived performance
Technical Details
What does this mean?
A sneak peek! The server is giving you hints about what's coming, like a movie trailer before the main feature.
Technical Definition
Used to return some response headers before final HTTP message.
RFC Says
"The 103 (Early Hints) informational status code indicates to the client that the server is likely to send a final response with the header fields included in the informational response."
Plain English:
The server is giving you a preview of what resources you'll need (like CSS and JavaScript files) before the final response is ready. This lets your browser start downloading them immediately for better performance.
Code Snippets
Ready-to-use code for returning this HTTP status in your application:
Node.js
// Express.js
app.get('/example', (req, res) => {
res.status(103).json({
error: 'Early Hints',
message: 'Your error message here'
});
});
// Native HTTP
const http = require('http');
http.createServer((req, res) => {
res.writeHead(103, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
error: 'Early Hints',
message: 'Your error message here'
}));
}).listen(3000);