-
Notifications
You must be signed in to change notification settings - Fork 23
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
Support for content length/size in Link Objects #107
Comments
In case it's useful, for the experimental work I did on WP manifests so you can read directly from a ZIP without having to parse, the structure was: {
"method": 7, // ZIP compression method
"offset": 123, // Offset from the beginning of the ZIP
"uncompressedSize": 4567, // Uncompressed resource size
"compressedSize": 1234 // 0 if not compressed
} If you just have the length alone, it doesn't help as much for range reads, because you're still going to need to parse the central directory and that has the lengths as well. For the hash, I would suggest having a prefix indicating the hashing algorithm used, such as |
That structure would show up under This issue is mostly focused on adding a new top level property, similar to The uncompressed size would make the most sense to me in that case, while an extension dedicated to packages and/or compression could cover the other three elements. |
If I go back to your example above @chocolatkey, this could look like this: {
"href": "chapter1.mp3",
"type": "audio/mpeg",
"size": 234,
"properties": {
"archive": {
"method": "deflate",
"offset": 123,
"compressedSize": 123
}
}
} I'm not entirely convinced by the use of an integer by Update: Replaced |
In the mobile toolkits we have something similar but we used an As it was an extension, it is a URI: {
"properties": {
"https://readium.org/webpub-manifest/properties#archive": {
"entryLength": 1234,
"isEntryCompressed": true
}
}
}
I agree. |
That's a good point. We might need to think about the use cases though, for example would we ever need to use this for streaming over HTTPS as well? |
@chocolatkey @mickael-menu I've updated the example above based on the feedback so far. I'd like to open a PR for a new module dedicated to that, but wanted to point out that there's a bit of redundancy currently with the encryption module: https://github.com/readium/webpub-manifest/blob/master/modules/encryption.md This module already contains IMO, cleanly separating properties that are related to encryption from the ones related to the use of an archive is a good idea overall. |
We've discussed this extensively with @chocolatkey earlier this week and we seem to be in agreement to do the following:
Here's an updated example based on this plan: {
"href": "chapter1.html",
"type": "text/html",
"size": 234,
"properties": {
"archive": {
"method": "deflate",
"offset": 123,
"compressedSize": 123
},
"encrypted": {
"scheme": "http://readium.org/2014/01/lcp",
"profile": "http://readium.org/lcp/basic-profile",
"algorithm": "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
}
}
} |
why archive.compressedSize instead of just archive.size? (for example when archive.method is store instead of deflate) |
If we're sure that people won't confuse the But if we're talking about |
The LCP spec allows links to contain two pieces of information that are currently missing in RWPM:
As we're working on accessibility, both pieces of information are becoming increasingly useful.
Content length is also useful for other things, for example in order to optimize how you can do a partial fetch on a packaged publication.
I would recommend using
length
and have it behave exactly likeContent-Length
in HTTP headers in terms of value.Any thoughts on this one?
The text was updated successfully, but these errors were encountered: