HTML5 website game - assets loading twice?

0 favourites
  • 6 posts
From the Asset Store
Is a circular loading screen with code ready to use. No Animation.
  • Hey folks.

    Currently working on a little app that I am considering hosting on my website for users to access in the browser.

    In particular, I'm keen to keep download sizes / loading wait times to a minimum, so have been doing a few tests.

    Bizarrely, the total size of my exported HTML5 game is around 7MB. However, when I upload the app and visit it with a Chromium browser, the browser seems to somehow pull down 12MB of files. Looking more closely into it, it seems that a lot of the PNG assets are somehow being loaded twice?

    Anybody have any idea why this is happening? The app isn't anywhere close to complete, so it's worrisome that loading times are already double what they should be. What's going on?

  • After doing a little more digging/detective work, I may have partially answered my own question. It seems that the game loads and runs after pulling the correct 7MB of data, then downloads the additional duplicate stuff after launch.

    The console gives me the message: [SW] Caching 34 files for offline use.

    So, it seems the redownloading of files is due to the game caching itself (hence why it loads very quickly at the next refresh) and doesn't impact the initial load time as the game is already up and running while it is doing this in the background.

    That's cool with me - it doesn't affect the initial load speed and in fact improves load times thereafter.

    I just have a small remaining question about the caching - this seems like it creates problems when I update the game.

    As a test, I made a small change to data.json and reuploaded it (in this case, I made a small alteration to one of the on-screen text elements). Then when I visited the game page, the change was NOT reflected until I cleared my cache.

    I intend to update this game a lot - how can I make sure the cache is only used when the game hasn't been changed since the last visit?

  • use those

  • Ahh! Thank you Eleanor. Not immediately sure how to use them but I will do some reading. Thank you for pointing me in the right direction :)

  • on update found, say "whoopsie doopsie~ dewe's a nyew vewsion downwoading and it's awmost weady~ i am vewy sowwie :3 "

    on update ready, open box to confirm browser action reload when clicked

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • "whoopsie doopsie~ dewe's a nyew vewsion downwoading and it's awmost weady~ i am vewy sowwie :3 "

    I will quote that verbatim ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)