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

ID placement in messages #421

Open
jscheid opened this issue May 19, 2024 · 0 comments
Open

ID placement in messages #421

jscheid opened this issue May 19, 2024 · 0 comments

Comments

@jscheid
Copy link

jscheid commented May 19, 2024

The id property in the serialized response is currently emitted at the very end of the message. There is nothing inherently wrong with this, and it's definitely in spec. However, it means that the other end cannot easily apply certain optimizations, including

  • starting to process partial responses before the entire response has been received, and
  • skipping (parsing of) large responses whose contents they are not interested in.

Such optimizations perhaps aren't important for a majority of messages and may not be without drawbacks. However, if there's nothing speaking against moving the id it would be a (small) win.

For what it's worth, this is also the order found in the spec examples. Not that it matters much but it definitely wouldn't be an unusual thing to do.

For consistency perhaps it would be good to move the id to the front of requests as well, as opposed to responses. It would enable the other end to respond to a partial request early.

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

No branches or pull requests

1 participant