My problem is not a C2 bug I think, cause I have all the things that may be requied for a perfect working update, but the only way to make it sure is to ask You...
I have a "game" uploaded into the Chrome Webstore with the documented process: export as CWS app, zip the whole structure and upload. It works great, and uses offline.appchache (saw it in Chrome's dev tools).
I've changed a music file - with different content, but the same name. Incremented version number (1.0.0 to 1.0.1) and re-exported project as CWS app uploaded and published the app in CWS.
It were now about 4 days ago. When I start the app in my Chrome browser, it uses the old files especially my old music file.
What I did to solve this:
1. Searched for the Scrirra.com, and found this threads: scirra.com/forum/chrome-refreshing_topic53357.html
2. According to the last link (offline apps) I've compared the offline.appchache files of the 1.0.0 and 1.0.1 versions:
Unfortunately I'm not able to find a way to export the offline.appcache file from my browser to compare with 1.0.0 and 1.0.1
I would like to ask for your help or your experience about this problem!
Do anyone use Chrome Webstore with regular updates, and used to replace sound/music files?
If you want to update a single file in your game, you need to do all of the following:
1. Export the project again from C2
2. Upload the file you want to update *and* offline.appcache (with that name - note you spelt it wrong in your post, just pointing it out in case it is the source of the problem)
3. Once uploaded, load the game again, wait a minute or two, then close and reopen the game again. You have to load it twice - the first time it notices the update is there and downloads it, but plays the old version in the mean time. The second time it loads the update.
Are you sure you've done all that? More information in the offline games in C2 tutorial.
Ashley I've just spelt if wrong, did not changed the filename after export. I think I do exactly what you described.
1. New export from C2.
2. Uploaded all of the files zipped as a hosted app to CWS.
3. Went to new tab in Chrome, started the installed CWS application, used it for several minutes to take enough time the update to complete.
Espected: the apps updated in the background, and the new music file is loading from the cache.
But I get: the old music file is playing from the Chrome's cache (saw it in Chrome's Dev tool/Network).
Additionally I see the new version number (1.0.1) of my app in the Chrome/Settings/Extensions list.
Things that may cause the problem:
1. I used to remove the music file in C2 and than added it with the same filename. The source file was story1page1.wav and the encoded story1page1.ogg. The old and the new file is not the same in size.
2. I noticed, that C2 places this updated music file at the bottom of the offline.appcache file.
3. Probably some bug in Chrome Webstore itself with publishing/distributing updated versions of offline.appcache file (I searched for similar threads in Chrome Webstore Dev discussion group today with no success).
4. Probably some bug in Chrome Web Browser (I use 20.0.1132.57m). I found a bug that seems to be similar, but with V18 of Chrome: code.google.com/p/chromium/issues/detail
Ashley I would like to inform you, that I've got some reply about this bug in the Chromium issue tracker: http://code.google.com/p/chromium/issues/detail?id=117375
As I understand, they sad, that the HTML standard do not force browsers to use the new app cache instead of the browser's own (old) app cache.
I've not a pro, so my only hope is that you can look at this thing, and probably tell me (us) if you can assist to solve it!
My biggest problem that even if I can ask Users to press F5 or Ctrl+F5 to refresh, Chrome keeps reading the .ogg files from their cache file, so it will never update!
Do you have any idea how can I solve this problem in C2 by programing?
Ashley I can not sit back, and wait, so trought to make all things I can to provide more informcation about this problem.
I found a way to list the offline.appcache files in Chrome: chrome://appcache-internals/
And hey! I have no offline.appcache for my app, and my another game app in Chrome Webstore too!
This is the links:
According to this experiance I've tested more apps from Chrome Webstore:
Animals Puzzles - chrome.google.com/webstore/detail/capejcicmbnfpkfbbnkinnogolckbido
Angry birds - chrome.google.com/webstore/detail/aknpkdffaafgjchaibgeefbgmgeghloj
The most interesting is that Animals puzzles do not have a working appcache too, but Angry Birds have a working one!
My app's HTML5 exported version tested in my own server also uses the appcache, and I have in the Chrome's list.
Now I'm sure that the Chrome Webstore makes something special with the offline.appcache files! And as Angry Birds solved it someway, Scirra may test they solution!
Ashley Please solve this seriuos and blocking bug about CWS export/appcache, cause I found 3 non-working and 1 working example for this!
Develop games in your browser. Powerful, performant & highly capable.
Sorry for the late reply, I had a week off.
This sounds more like a Chrome bug to me so it might be better to watch that bug report - as per the HTML5 spec, Construct 2 exports a modified offline.appcache file with changed contents to trigger an update, and if reloading a few times does not update the files then Chrome is not acting in a standards compliant way.
What I think is the workaround is to submit your game as a hosted app on your server, rather than hosting it on the Chrome Web Store itself. It will still work perfectly offline, you just need to be online for the first play. Perhaps the other Chrome Web Store apps which seem to have working appcaches use this approach too.
Thank You Ashley! I'll try the self hosted way, and see what happens...
Ashley the hosting on own server did the job. The appcache now working great...
So I can confirm that the Chrome Webstore publish have 2 options related to app caching:
1. Upload and host on CWS - the Chrome browser will not use the offline.appcache file, instead use their own standard website caching, what makes impossible to update contents like graphic or audio - if the filename is the same.
2. Host on own server - requies a MIME config, but perfectly provides the full appcache functionality, so makes the content update as easy as we can find in the tutorials.