Page 1 of 1

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

PostPosted: Sat Jun 17, 2017 12:55 am
by Moerk
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?

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

PostPosted: Mon Jun 19, 2017 7:19 pm
by gumshoe2029
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

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

PostPosted: Mon Jul 10, 2017 11:00 pm
by Moerk
Thanks for the advises.

How do you trigger an update manually?

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

PostPosted: Fri Jul 14, 2017 6:25 pm
by gumshoe2029
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:
Code: Select all
<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>


This way, it updates the c2runtime.js every hour, while image files it only refreshes every 6 months.