Hi,
I am building a webplayer game. When I upload a new version of the .unity3d file this new version is not used but the old one is displayed.
I don’t know what is the problem, maybe a cache problem, and how to solve it.
Thanks a lot !
Hi,
I am building a webplayer game. When I upload a new version of the .unity3d file this new version is not used but the old one is displayed.
I don’t know what is the problem, maybe a cache problem, and how to solve it.
Thanks a lot !
Clear the browser cache?
Thanks,
Chris
I think if a user wants to play a new version of the game he will not clear the cache each time.
Probably the easiest thing to do is to slightly rename the file.
You wouldn’t need to clear the browser cache each time, once your newly updated .unity3d file is uploaded, you should only need to the clear the cache once, that will force the browser to fetch the new version instead of loading your cached version.
As AdrianC suggests you can also change the filename as well.
Thanks,
Chris
For what I found I can do what I want with meta http-equiv=“cache-control” content=“no-cache, must-revalidate”. But where can I apply those settings ?
Try this,
i think it works
if(Caching.IsVersionCached(url,1))
{
Caching.CleanCache();
}
I solved this problem creating a .htaccess file in the same directory that the *.unity3d file, with these lines:
Header unset Pragma
FileETag None
Header unset ETag
# cache file for 2 hours (7200s)
<FilesMatch "\.unity3d$">
Header set Cache-Control "max-age=7200, public, must-revalidate"
Header unset Last-Modified
</FilesMatch>
Credits to Kryptos (Webplayer unity3d file cache - Questions & Answers - Unity Discussions)
Little tip:
To test, first Clear your Browser Cache manually, and if you change the max-age to smaller value, you need Clear the Browser Cache manually again.