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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.