F
F
FeNUMe2011-08-26 05:52:14
JavaScript
FeNUMe, 2011-08-26 05:52:14

Javascript unpacking resource archive on client?

I recently discovered that some Flash / FLEX toys use a simple and effective optimization when loading - all graphic resources (heaps of pictures) are packed into zip packages, and then they are used on the client already from the archives (I think games are unpacked into memory during loading). This saves a lot of requests to the server. So I'm wondering if it's possible to do the same in the html5 toy where js+canvas+indexeddb is used.
I think many will suggest using sprites to save requests, but this is not an option when all graphics can take up to 50mb.
I also know about packaging html / text to png and unicode text + lzw (gzip) - but this is a bit not the case.
In general, the task is to load all the resources in several packages that are cached and use them from these packages or, as an option, correctly unpack them into the cache (I think not really) or into the local database, but this is an obvious perversion.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Indutny, 2011-08-26
@donnerjack13589

You can use gzip compression on your server and something like an asset pipeline. It will be much more efficient.
You can also try to unpack using: developer.mozilla.org/en/javascript_typed_arrays , but here you need to look for a port of zlib or something in javascript.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question