Since I have seen various reports of caching issues and haven’t gotten a concise answer to how caching currently works in WebGL, I wanted to open it up for discussion (and answers from the Unity team, if possible).
Based on my experience thus far, here is how I believe caching works/doesnt work in WebGL:
-
Uses the local browser cache store (indexedDB, etc) to cache assetbundles.
-
Question: Is this only the case when using WWW.LoadFromCacheOrDownload or does the “new WWW” constructor also utilize this cache?
-
IndexedDB doesn’t work in Firefox in iframes (i.e, Facebook Canvas apps) Details on this thread.
-
Question: Does this basically mean there is no caching for Unity WebGL Facebook apps in Firefox currently?
-
In Firefox, “clearing browser cache” does not actually clear the indexedDB database like it does in other browsers. The user’s profile folder/indexedDB must be deleted.
-
I read something somewhere that suggested loading assetbundles sequentially in a WebGL app rather than through coroutines because of the way disk i/o was handled (or something to that effect). Any truth to that?
Please share your caching experiences and if anyone has the answers to these questions, Id love to hear them.
Thanks much!