question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to support HTTP 103 Early Hints?

See original GitHub issue

hi,

WIth Chrome 103, the HTTP 103 Early Hints is in release build. But how to support this in expressjs? Thanks!!

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103 https://developer.chrome.com/blog/new-in-chrome-103/

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Oct 7, 2022

No, it’s not a wrapper, it is inheritance. Anything on the Node.js response is on the Express.js response, because it’s just class inheritance. The Express.js response is just a subclass of the Node.js response. You’ll notice you can call res.writeProcessing() and res.writeContinue() in your Express.js middleware, yet you won’t find those anywhere in the Express.js source code, since nothing needs to be done to add methods from the Node.js classes to the Express.js ones. I hope that helps.

0reactions
fishcharliecommented, Oct 7, 2022

@dougwilson Thanks so much for the reply.

Everything (minus one part) you said makes sense and I agree with all of it.

Once that PR lands in Node.js, the API is automatically available in Express.js when used with that Node.js version

This is the part I’m slightly confused about. I was under the impression that Express.js was basically a wrapper around the Node.js HTTP package. Therefore, wouldn’t the wrapper need to be updated to support that new method?

Methods such as res.set don’t exist within the native HTTP package (I assume it gets mapped to response.setHeader).

So shouldn’t Express.js (at some point) add a new method for the writeEarlyHints method that was added in that PR? Similar to how res.set maps to response.setHeader. Something like res.earlyHints that gets mapped to response.writeEarlyHints?

Read more comments on GitHub >

github_iconTop Results From Across the Web

103 Early Hints - HTTP - MDN Web Docs
The HTTP 103 Early Hints information response status code is primarily intended to be used with the Link header to allow the user...
Read more >
103 Early Hints: What It Is and How to Implement It - NitroPack
103 Early Hints is the new HTTP status code that helps browsers decide what content to preload before the page has even started...
Read more >
Beyond Server Push: The 103 Early Hints Status Code | Fastly
Sending 103 Early Hints allows the client to use the idle bandwidth to download those assets while the server is “thinking.” For example,...
Read more >
103 Early hints - Web Core Vitals and Pagespeed consultancy
The 103 Early hints is a lightweight 'non-final' server header with the status code 103 and the name early hints. This header is...
Read more >
Chromium Docs - 103 Early Hints
You can opt any page on your origin into Early Hints by requesting a token for your origin. Include the token in both...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found