Cache / update cache resources in Construct 2

Get help using Construct 2

Post » Thu Dec 27, 2012 9:07 am

Good time guys! I'm interested in the question "Cash Resources Construct 2 html5". I have created an application that published it. Does caching resources at the reopening of the game (application) in the same browser? Time passed, I released an update, it changed graphics, sound and more. Will there be a game update (new graphics, sound, and more) for users who have already run it in my browser? What mechanisms exist to Construct 2 to work with the cache? Forgive me for my bad English.
B
9
S
3
G
1
Posts: 29
Reputation: 2,207

Post » Thu Dec 27, 2012 12:16 pm

Okay, I suppose that your application is hosted on one of your websites. If that's right, when you make an update,you will have to edit the index.html, or the page where the game is ebedded.

Find this line <script src="c2runtime.js"></script> (it calls the game runtime), and change it to: <script src="c2runtime.js?version=x"></script>
where x it's the version of the game, the browser will know that you have a newer version of the code, and will flush the chace memory and get the current script.
B
15
S
3
G
2
Posts: 42
Reputation: 2,412

Post » Thu Dec 27, 2012 2:08 pm

@wildmedia - that probably won't work because Construct 2 uses the HTML5 AppCache, which I think takes precedence over any query string changes.

@wizsg - see the tutorial Offline games in Construct 2 which details how Construct 2's automatic caching works, and how updates work.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Thu Dec 27, 2012 4:02 pm

The function that C2 uses is written in the c2runtime.js, am I right? If I'm right, it will work because the browser will get the new c2runtime.js before any other action, it will download before rendering the view.
B
15
S
3
G
2
Posts: 42
Reputation: 2,412

Post » Thu Sep 15, 2016 8:09 am

wildmedia wrote:The function that C2 uses is written in the c2runtime.js, am I right? If I'm right, it will work because the browser will get the new c2runtime.js before any other action, it will download before rendering the view.

Thanks! It works perfect!
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, PavleNikolic and 23 guests