0 Favourites

Cache / update cache resources in Construct 2

  • 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.

  • 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.

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,348
FlyingRam's avatar
FlyingRam
Unread hot topic Locked topic
0 Favourites
Construct 3 any news?
889 125,630
uzumiapps's avatar
uzumiapps
Unread hot topic
0 Favourites
CocoonJS plugin updates
519 48,598
tuzke's avatar
tuzke