- Home /
Using CachedXMLHttpRequest
Hello, I looked at the asset from Unity https://www.assetstore.unity3d.com/en/#!/content/71538 and tried implementing it. There is pretty much 0 documentation and the only semi detailed explanations were 3rd party blogs like https://blog.kongregate.com/unity-webgl-memory-optimization-part-deux/.
This package is suppose to store your asset bundles out of memory so that they do not take up memory during runtime. If you have 5 bundles, they will all be constantly in memory even if you are not using them.
I tried implementing this package but my IDBFS database is still full and still in memory. Is there any C# modifications i need to make to use this package? How do i implement besides add the package to my project?
Thanks Mitch
Answer by Bunny83 · Jul 08, 2019 at 02:45 PM
The package comes with exactly two asset files: The actual "jspre" library and a readme.txt file. I don't quite get your "0 documentation" statement.
Anyways, the library is a js module which is automatically available. You don't have to do any thing special. However in your C# code of course you have to use the ordinary UnityWebRequest or the WWW class and not using any of "LoadFromCacheOrDownload" stuff. This module will automatically cache all http requests that go through WWW or UnityWebRequest as long as no custom request headers are used and the server actually returns an ETag header.
I don't quite understand your last paragraph. If your client side indexed DB is "full" (which i doubt), you can not cache anymore files.
So you should use WWW or UnityWebRequest to do the actual downloading and then make sure you actually cleared the cache on the client side / browser.
Thank you for your help! I missed the part about using WWW or UnityWebRequest. Will convert from LoadFromCacheOrDownload to WWW. Will update with results when i am done.
What i meant by the last paragraph is that my bundles still existed in the IDBFS database. Even the ones that according to my understanding of the package should not have been there anymore. $$anonymous$$ust be because i'm still using LoadFromCacheOrDownload.
Your answer
Follow this Question
Related Questions
Asset bundle shader standard 0 Answers
Distribute terrain in zones 3 Answers
WebGl build on Server has load memory error 6 Answers
Cloud Built WebGL Stopped working 0 Answers
WebGL builds in version 2020.2.1f1 are not working? 4 Answers