Skip to content
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

Only handle session once for a http2 stream? #70

Open
wmertens opened this issue Sep 6, 2019 · 2 comments
Open

Only handle session once for a http2 stream? #70

wmertens opened this issue Sep 6, 2019 · 2 comments

Comments

@wmertens
Copy link

wmertens commented Sep 6, 2019

Since a http2 stream can have many requests on the same TCP connection from the same client, it might be interesting to key the session on the stream connection instead.

This way, there would be no overhead when a single stream does 100 requests.

@SerayaEryn
Copy link
Owner

This is a good idea. I guess that would allow to skip the unsign() of the sessionId on every request.

Would you like to open a PR?

@wmertens
Copy link
Author

wmertens commented Sep 6, 2019

I'll keep it in mind, I was exploring fastify.

The req has a .stream member for h2 connections, and that has a .session member, which could be used with a WeakMap to look up sessions, and it emits a 'close' event when the session drops. So probably it won't be hard to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants