-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP/2 stream question #69
Comments
done-ssr supports the native http2 module, not spdy. Express doesn't yet support http2. So if you want to use Express you're stuck with http1 for the time being, unfortunately. |
@matthewp Thanks for your reply. I have a few questions:
I guess the main thing I'm trying to figure out is if it is possible to layer all the goodies like incremental SSR rendering with HTTP/2 server push and bundle manifests on top of a framework like Express in an app already using various other Express-compatible middleware. I think this is what most people who already use Express in their app will want to do, so that they don't have to write the majority of the server code for their app themselves (probably why they are using Express to begin with). Obviously I'm pretty new to this and just trying to figure out what I need to do to make my existing Express app work with all the cool new stuff, so let me know where I've got things mixed up. |
Some times Chrome has PUSH turned off even for HTTP2 connections because they like to do A/B tests on how it will affect performance. In this case we'll use the preload links like we do with HTTP1. It's still faster than HTTP1 because of the shared TCP connection, but not as fast as PUSH. I obviously understand the desire to use Express. But until it supports HTTP2 there's really nothing we can do. Making done-ssr flexible enough to work with HTTP1 and HTTP2, which as I said before are much different APIs, was a lot of work. |
For some context on where Express is with H2 support, here their maintainer about it. Reading that, I experienced the same difficulties with making done-ssr and done-serve support either API. done-serve used to use Express but I had to remove it. Now it has its own middleware layer that's basically a less-nice express. |
In the done-ssr 3.0 release notes @matthewp gives an example of using HTTP/2 in which he provides done-ssr the
headers
object:Does this happen when using
done-ssr-middleware
with Express?I tried to determine that myself, and saw that
done-ssr
willreturn new SSRStream
:https://github.com/donejs/done-ssr/blob/99e1adc7eb4901686f4598db36ef6809901ccf59/lib/index.js#L29
Which has a
SafeStream.prototype.pipe
function like:https://github.com/donejs/done-ssr/blob/99e1adc7eb4901686f4598db36ef6809901ccf59/lib/ssr-stream.js#L127-L131
That
done-ssr-middleware
calls withres
like:done-ssr-middleware/lib/index.js
Line 32 in e1b4b02
Does that mean
done-ssr-middleware
with Express is equivalent to the direct usage ofdone-ssr
in the release notes example? I don't see anything listening on "stream" like:Note: I'm also using the
spdy
npm package instead of native the http2 module.The text was updated successfully, but these errors were encountered: