0 Favourites

How do I trigger "On update ready" & "On update found"?

  • Seriously, I'm struggling with this for a while now and i can't get it to working. Those triggers were working before they were removed and reimplemented.

    Is there something i am missing? I know how to implement them. I wondered if there was probably sth wrong with my webspace server settings about the appcache file?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You can just use the appcache file to control the "max-age" of all of your web content directly. If you have dynamic access to the HTTP headers you can dynamically set these. I use Apache's mod_headers to do it for me.

    See: http://metaskills.net/2006/02/19/how-to ... -apache-2/

    Alternatively, you can include a "version" tag in your javascript or html that if it doesnt match the current version you can trigger an update manually in C2.

    Or you can do a URI-based version control system, like:

    www.example.com/game/client/v1.49.4556

  • Thanks for the advises.

    How do you trigger an update manually?

  • You set the content max-age to less than now, and it will cause the client to re-download anything with max-age < now.

    For example, I have my Apache set to vary the max-age header by content type:

    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType image/gif "access plus 259200 minutes"
      ExpiresByType image/jpeg "access plus 259200 minutes"
      ExpiresByType image/png "access plus 259200 minutes"
      ExpiresByType text/css "access plus 60 minutes"
      ExpiresByType text/javascript "access plus 60 minutes"
      ExpiresByType application/x-javascript "access plus 60 minutes"
      ExpiresByType text/xml "access plus 60 minutes"
      ExpiresByType application/json "access plus 1 seconds"
    </IfModule>[/code:xmmbxtf1]
    
    This way, it updates the c2runtime.js every hour, while image files it only refreshes every 6 months.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)