Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Refreshing HTML5 not using updated code/assets — Gideros Forum

Refreshing HTML5 not using updated code/assets

Hey, all. I'm see an issue with a game exported to HTML5. The first time it's accessed with any browser instance, the "loading application" progress takes a few seconds, presumably as it's downloading the *.gidz file. If I refresh the page in the browser, or come back to it later, the "loading application" is done almost instantly, presumably because it's cached from the first time, which is good.

But if I make updates to the game, export, upload and refresh the page, I still see the old version. Even if I bypass the cache (for example by holding down Ctrl and clicking the refresh button in Chrome), the new version isn't loaded. That makes me suspect it's not a question of what the browser caches, but what Gideros stores for re-use.

Is this a matter of Gideros code storing the application data in the client-side database and not checking for a newer date or changed version? Or is there something I can do in the project or export to make sure existing users get the latest version of the application when they load the page?

One workaround would be to upload to a different folder with each update, and have the main page for the game redirect to the folder with the latest version, but would that prevent the saved data in the Documents folder (i.e. game progress) from carrying over to the new version, if the game was loaded from a different URL? Or is the Documents folder the same as long as the project name is the same, regardless of the full URL from which the application was loaded?

Paul

Comments

  • imho the Documents folder always points to the path you define. If you do:
    myprefs = "|D|saveprogress.txt"
    then as long as it is the same path in your app it will point to this file, at least that's what I experience on windows apps.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • The issue is if the app is an HTML5 export accessed from a different URL, on the client side it seems to be treated as a different app with its own separate Documents folder. I just tried a test app that just counts how many times it has been run, storing the count in a file in Documents, and shows the run count on the screen. It works fine, but if I move the app to a different folder on the server (so the URL to access the HTML5 app is different) the run count starts over.

    This means the workaround I was considering isn't an option. If I changed the URL when the app updates, to ensure the latest version gets run and not a cached version, the client side treats it like a new installation of the app, and all saved files (game progress) would be lost.

    But with this test program, any time I changed the app, export to HTML5 and uploaded it to the same folder, the updates took effect when I refreshed the page in the browser. So I'm not seeing the problem I'm having with my actual game. With the game, I've done that repeatedly and I'm still seeing an older version.

    Does anyone have any ideas why an HTML5 export might keep running code from an earlier run, seemingly skipping the step of downloading the current .gidz file?

    Paul
  • Closing the window on Chrome and returning with a new window seems to load the latest code. It's still a mystery to me why refreshing, even a non-cached refresh of the page, won't always reload the latest application code, but as long as returning users will usually (or eventually) get the latest version of the app while retaining their progress, it's not really a problem.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.