Issue With Updating HTML5 Version To My Website

Hi,

Took a long break, but have just returned to Defold.
When I upload new version of my HTML5 game to my website, the old version is shown?
If I clear browser cache and reload the game then the new version is shown?
Any way to fix the above, I can’t keep telling players to delete their browser cache…
Thanks!

Here is the HTML5 game demo:
http://fallenangelsoftware.com/stuff/files/RedLightRacer/HTML5/js-web/Red%20Light%20Racer/

Jesse

1 Like

@Axel
@britzl

Feature Request: MD5 Cache.

1 Like

This is a consistent issue with all the HTML5 game engines I have used.
I contacted my hosting provider and explained the issue to them.
Perhaps they can modify the site’s cache settings or something…

Jesse

up

My hosting provider says they have no control over browser caching.
Hope the Defold devs can fix this on their side soon.

Jesse

Did you fully delete the older files you uploaded previously?

If so the problem isn’t Defold it’s your browser cache. This is NOT something Defold can solve for you.

If you want to guarantee a new download then you need to change the links to the files (easy way to do this is to add a version number at the end like ?v=1.1) or change the TTL of your Apache file server (which you use according to your site’s headers). I looked at headers of some of your files and it looks to be 3 days long currently.

2 Likes

No, don’t touch the server config.
What We need is a MD5 Cache.
Look at this:
https://www.alainschlesser.com/bust-cache-content-hash/

That seems fine to do. For people who don’t click the link, what Defold could do is add hashes to the filename of generated files which impact loading of other files and caching.

So instead of game.arci0 it could be game-d58e3582af.arci0 and it could be done by the bundler.

Possibly it could be possible for a user to create a tool which could scan bundled HTMl5 versions and rename files to include the hashes / edit the related files to point to the proper versions.

I didn’t know some browsers don’t cache links with like ?v=1.1 I think it’s only depreciated versions of Firefox? So not an issue in 2018?

@COCO you should make an official feature request on the github for this.

I think you can add

+'?v={{project.version}}'

everywhere in index.html where you have file paths. It should work, but I’m not sure that it works with internal Defold web server

Exactly.

1 Like

Isn’t this what Archive Location Suffix is used for? To force a cache update?

Perhaps I misunderstood the feature and now wonder what it’s good for.

1 Like

This is for adding ?v=1.1 style of thing. Hash based filenames would be a little different. The benefit of hash based filenames would be if a certain file is not modified between builds it doesn’t get redownloaded again.

1 Like

Hi,

Does the “index.html” file change with each build?
I really need a solution to this problem.
I’ll try the above for now, but the Defold devs really need to address this on their side.

Jesse