I was having a hard time trying to cache my HTML5 app and realized a big part of this was because the code is throwing random numbers to prevent caching. Relevant topic: Assets overwriting, dead resources and cache buster
I went on the produced .js file and commented that out, making it always go for the regular file, without parameters, and my app works flawlessly now. By looking at the source code that’s referenced on the topic above, it doesn’t look like I’m able to make my app not use that trick… which means every time I compile it I’ll have to make the changes.
Sorry for the delay, what is the purpose of not having a cache string?
The cache string is used once per compile, this means that one version of your application should cache, but new versions should break the cache. This might be an ideal balance between keeping the cache when revisiting (unlike a random cache break string) and no cache breaking at all (which won’t deal with updated files with the same name)
For some reason we were not being able to load a cached version of an app when the cache string was present. I was debugging via Safari and it would ask for a different file when I simply reloaded it…
I’ve fixed this issue - there are 2 pull requests waiting which make the caching controllable by the user.
[github]
lime/pull/729
openfl/pull/1130
1130 depends on 729, not sure what the procedure is for that case.
This allows for the current behavior if the user does not specify their own cache version, and better behavior if the user chooses to override it.
This should cache once per compilation, which was the original idea. Sorry this was breaking all caching, entirely
@player_03 that’s a good idea, but I wonder if someone might end up doing clean builds which delete the build number, so that the cache string would be the same every time.