CfC: Proposal to add web packaging / asset compression

Hi everybody,

This is a proposal to add a packaging format transparent to browsers to the charter. At Zynga, we have identified this as one of our most pressuring issues. Developers want to be able to send a collection of assets to the browser through a single request, instead of hundreds.

Today, we misuse image and audio sprites, slicing them again as base64 only to put them into weird caches. These are workarounds, and ugly ones, as well. None of the workarounds is satisfying, either in terms of robustness, performance or simply, a sane API. Coincidentally, this is also one of the most pressuring issues of WebGL. Since you are dealing with a lot of assets with WebGL games, proper solutions must be found.

A ticket at Mozilla, describing the issue further, has been opened by us here: https://bugzilla.mozilla.org/show_bug.cgi?id=681967

Here's an actual code draft I attached to the ticket:


window.loadPackage('package.webpf', function() {
    var img = new Image();
    img.src = "package.webpf/myImage.png";
})

Or alternatively, with a local storage system (I prefer option one):


window.loadPackage('package.webpf', function(files) {
    files[0].saveTo('myImage.png');
    var img = new Image();
    img.src = "local://<absolute path of url of site>/myImage.png";
})

No big deal if the whole API looks entirely different when it's done. The format needs to be able to handle delta updates well, and must be cacheable. It needs to be transparent to the browser, and assets of uncompressed web packages need to be able to be included from CSS. I am aware this is a more inconvenient addition to work on, but there is immediate need.

This is also a call for implementors, testers and editors. I am unfortunately not experienced enough to handle any of those jobs.

Thanks, I'm looking forward to feedback!

Paul Bakaus
W3C Rep and Studio CTO, Zynga

Received on Tuesday, 14 February 2012 09:25:28 UTC