Re: jar protocol

On 07/05/2013 22:31 , David Sheets wrote:
> On Tue, May 7, 2013 at 3:29 PM, Robin Berjon <robin@w3.org> wrote:
>> WDYT?
>
> This is really cool!

Glad you like it :)

> Most servers already contain support for this in the form of index files.
>
> If you do
>
>      <link rel="bundle" href="bundle.wrap/" />
>
> and set your server's file directory resolver to match index.zip, you
> don't need any special server-side extraction or handling: just
> extract the archive root as sibling to index.zip when you deploy!

Heh, hadn't thought of that — nice hack!

> One quirk of this scheme (ha) is its notion of "root path". With this
> path pattern match, the subresources in the archive exist in the
> domain's single top-level path structure. This means that for archives
> to be fully self-contained they must only use relative references that
> do not escape the archive root. Of course, this is also a feature when
> the containment of the archive is not a concern.

Sorry for being thick but I'm having trouble parsing the above. Would 
you mind rephrasing?

> How does directory resolution inside a bundle work? i.e. resolve
> "bundle.wrap/dir/" ? It seems like this (listing) is a key feature of
> the "API" that was being discussed. I support a JSON object without a
> well-known name, personally.

I hadn't thought about directory listing. If the use case is just 
bundling it's not needed (we just need well-defined behaviour when 
fetching such paths); but returning something is definitely possible. 
Keeping in mind that this approach does not intend to replace a 
potential Zip API (unless there's overwhelming demand for it), do you 
have use cases for returning a listing of some form?

We don't have to decide this right now, I can keep it as an open 
question for the time being (so no need to rush to UCs).

> Can we use
>
>      Link: <bundle.wrap/>; REL=bundle
>
> for generic resources?

I'm not intimately familiar with RFC 5988, but it would seem logical if 
it Just Worked.

> Does
>      <a href="bundle.wrap/page.html">Go!</a>
> make a server request or load from the bundle?

That's an open question, but my first instinct would be "no". I'm happy 
to be convinced otherwise though.

> Do bundle requests Accept archive media types?

Sorry, I'm not sure what you mean. Are you asking about bundles inside 
bundles?

> Do generic requests (e.g. address bar) Accept archive media types?

You mean typing http://example.org/bundle.wrap/kittens.html? I would 
expect the browser not to do anything specific there. Which is to say, 
if the server returns the bundle (ignoring the path info) then the 
browser would likely prompt to download; if the server returns the HTML 
then it's just HTML.

Or do you mean something different with capitalised Accept? The HTTP 
header? I would rather leave it out of this if we can ;)

> What if I do
>      <link rel="bundle" href="" />
> ?

Presuming that doesn't resolve to a bundle (which it shouldn't) then 
it's a failure and no bundle gets added to the list of bundles.

> Could bundles be entirely prefixed based?

Sorry, I'm not sure what you mean here.

> What does
>
>      <link rel="bundle" href="bundle.wrap#" />
>
> with
>
>      <img src="bundle.wrap#images/dahut.png" /> <!-- or is it
> bundle.wrap#/images/dahut.png ? -->

I would expect the URL to drop fragments, I don't think they make sense 
in this context.

> do? Or
>
>      <link rel="bundle" href="bundle.wrap?" />
>
> with
>
>      <img src="bundle.wrap?images/dahut.png" /> <!-- or is it
> bundle.wrap?/images/dahut.png ? -->

The ? isn't really special, so with bundle.wrap?/images/dahut.png it 
should just work.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Received on Thursday, 9 May 2013 16:03:23 UTC