Implement 103 Early Hints
What is the problem this feature would solve?
Allow developers to push the required resources faster
What is the feature you are proposing to solve the problem?
Add an API to send early hints using Bun.serve()
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103
What alternatives have you considered?
Using node:http
This is something we could implement, but we'd need to think of an API design for it. Maybe something like this:
Bun.serve({
async* fetch(request) {
// Can yield multiple 103 responses
yield new Response(null, { status: 103 });
// Must return non-103 response, if yielded
return new Response(null, { status: 200 });
},
});
Any news? It would be a nice feature to have.
According to Cloudflare, Early Hints improve website load times by 30%.
Any news?
nodejs support writeEarlyHints from 18 version. And I need to rollback to nodejs again.
I use bun for run express. Bun don't sent request for writeEarlyHints, but function is exist and called.