Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [OT]-How To Force Web Page To Reload Recently Uploaded JavaScript?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 8th Dec 2017 17:57
Hi,

I have an interesting problem with HTML5 version of the AGK2 game:
If I upload new version I have to clear Internet browser's cache to see new version?
Is there a way to force a web page to reload new JavaScript?
Thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 8th Dec 2017 18:37
CTRL + F5 should force a full refresh of the page
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 8th Dec 2017 18:41
Hi,

Thanks for the reply.

Refreshing the Internet browser page does not work.
I have to go into Internet browser settings and clear entire browser cache, then new JavaScript is used after page refresh.

Any ideas?
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 8th Dec 2017 19:23
One popular trick (generally speaking as a Web dev) is to append a unique ID to the .js files referenced in the HTML. Actually, it would be convenient if AppGameKit did this automatically with a timestamp of the current build time, to avoid the caching issues including by users who may be viewing the app using older data.



If you rename the HTML file to .php and your server supports PHP, you can also add this to the very top of it to force disable cache from the server.


MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 8th Dec 2017 23:17 Edited at: 8th Dec 2017 23:20
CTRL+F5 (IE) CTRL+SHIFT+R for chrome (and firefox).

Or simply open developper tools (F12 for chrome) which disables cache by default when you load or reload a page.
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 9th Dec 2017 09:46
Hi,

Thanks, I'll try the JS code you provided...
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 15:17
Hi,

Game optimizations are completed.
( Game can be seen at www.16BitSoft.com )

In what files of HTML5 build do I add below code to?
-------------------------------------------------------------------------------
script.src = "AGKPlayer.asm.js?v=20171208120005";
-------------------------------------------------------------------------------

Thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 18th Dec 2017 02:35
You would have to modify it in the HTML file where the AppGameKit code is embedded). In your case that would be "DigitalCrack.html" and it would have to be modified each time you export a new build since AppGameKit will overwrite the changes, I believe. Can't guarantee how well this will work as I haven't done much with AppGameKit HTML or experimented with how they handle caching.

Login to post a reply

Server time is: 2024-11-24 05:39:34
Your offset time is: 2024-11-24 05:39:34