- Home /
How to force refresh of webplayer content ?
I'm making a network multi player game. I publish frequent fixes by copying up a new .html and .unity3d export. Unfortunately player's browsers still sometimes load an old cached version instead of the new files. I've tried adding meta tags in the HTML to tell it not to cache. It's not working for me. Does anyone know how to disallow this caching, or force a fresh pull of the content each time?
Thanks!
Answer by OlivierPons · Nov 25, 2014 at 11:07 PM
Here's how I do when I develop Websites:
Try "Control F5" on your browser.
Try to always launch it on "private mode" then leave & restart each time to test (chrome command line option is "`chrome.exe" --start-maximized --incognito`")
Answer by HollettGaming · Nov 26, 2014 at 12:04 AM
I would try adding a querystring value to the end of the unity path.
For example when you call this in your html:
u.initPlugin(jQuery("#unityPlayer")[0], "pathToGameFile/gamefilename.unity3d");
Try this instead:
u.initPlugin(jQuery("#unityPlayer")[0], "pathToGameFile/gamefilename.unity3d?version=2");
I haven't tried it, but I do this with all my other resources such as flash games (gamename.swf?version=45) and also CSS files and javascripts so that the browser thinks its a new file name and reloads it.
Give it a try and let me know if this does the job or not?
Your answer
Follow this Question
Related Questions
How do I get the Editor title bar to update after calling EditorApplication.OpenScene? 0 Answers
Interactively work on a programmatic mesh 1 Answer
I've to refresh script's folder in Unity 3.1, Why? 1 Answer
I have to refresh everytime I want a script change to take effect. 0 Answers
Refresh File Resource Folder or File 2 Answers