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
Structured responses section for streaming loading #212
Labels
Comments
jyasskin
added a commit
to jyasskin/webpackage
that referenced
this issue
Jun 20, 2018
…order. This lets us store only lengths in the index, and compute offsets from them, which in turn enforces that the contents don't overlap and don't have gaps, making the content array well-formed CBOR. This applies to both the section index and the request index. Fixes WICG#212.
jyasskin
added a commit
to jyasskin/webpackage
that referenced
this issue
Jun 20, 2018
…order. This lets us store only lengths in the index, and compute offsets from them, which in turn enforces that the contents don't overlap and don't have gaps, making the content array well-formed CBOR. This applies to both the section index and the request index. Fixes WICG#212.
jyasskin
added a commit
to jyasskin/webpackage
that referenced
this issue
Jun 22, 2018
…order. This lets us store only lengths in the index, and compute offsets from them, which in turn enforces that the contents don't overlap and don't have gaps, making the content array well-formed CBOR. This applies to both the section index and the request index. Fixes WICG#212.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goal
Background
In the current bundle spec, the structure of the responses section is allowed to be very flexible and not required to be a CBOR construct.
Streaming loading algorithm for current format
When loading a bundle in a streamed fashion, currently the parser will:
Since there may be overlap in the response exchange, we need to keep around the original responses section in the buffer (which probably will reside on memory), since they may theoretically be used more than 1 time in a different CBOR interpretation. It is non-trivial to compute the "done" part of the responses section which are not referenced in later exchanges to partially free the original responses bytes buffer.
Non-streaming consumption of the small bundles
If the entire bundle is guaranteed to be a valid CBOR, it will become very easy to consume small packages which will easily fit in memory. If efficiency is not an issue, you can feed the entire package to CBOR parser, and consume the exchanges without implementing the full parsing algorithm.
For example, @irori created a live web demo of unbundler which assumes that the bundler output a CBOR array as response section.
Proposals
The text was updated successfully, but these errors were encountered: