Sign in to follow this  
Bonsaiheldin

Let the browser download the game's assets as a one archive file?

Recommended Posts

Hello there.

Reducing the number of files downloaded is important for faster loading browser games because often the number of parallel connections is limited to 2, 4 or 8.

So, i was wondering if it could actually work to load all the assets as an archive, extract it afterwards and then let the game grab and assign them.

Has anyone experimented with that? Maybe with some magic of the File APIs, somehow? Does that actually work?

Regards

Share this post


Link to post
Share on other sites

You can do that, I've used JSZip to do this same thing. No need for the File API as such, you can extract data from the zip as blobs or Uint8 arrays or whatever suits your needs.

To be honest it does speed things up a bit, but there may be better ways. For example if you use HTTPS then the client can do batched requests, and that's a big speed up.

The big disadvantage of the zip approach is that you can't cache individual files - if you need to change one asset, you need to change (and the client needs to re-download) the whole zip.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.