- Home /
Webplayer, Files and Cache
Hello everyone,
I am making an app that needs to download an .xml from a server. This file is used like a save file.
So I have a request like this:
new WWW("http://myfile.xml");
string data = www.text;
After that, I do some modification on my file and send it to an ASP MVC 3 site to store the file.
But sometimes, When I ask for my xml after that, I only have the old one, but the new is well saved. I think it's a cache problem.
My questions are, is it possible to force a download, not to use the cache ?
I saw a partial answer that say to do a request like this :/>
WWW("http://myfile.xml?nocache="+randomnumber);
Is it true ?
Another solution could be to send the file to the server and saving it in the cache so I always have the good xml in the cache and in the server.
What do you think, do you have other solutions ?
Thanks a lot !
Answer by whydoidoit · Aug 01, 2012 at 11:52 AM
You have to wait for the WWW to finish. You can do that using a coroutine and (in c#) yield return www. Or you can check the isDone property.
There is no problem with the coroutine, everything is well done.
It would be worth editing your question to post it then - as it looks wrong from what you have written. If this is a question about ASP.NET then I suggest you ask it on StackOverflow
I don't understand, my question concerns the Unity cache system or maybe the browser. I don't know how to force the download ins$$anonymous$$d of using the cache with unity. I saw some things but there are not very useful (LoadFromCacheOrDownload, temporaryCachePath)
Unity can cache asset bundles but it will request your .X$$anonymous$$L file every time. Your web server could be caching it - the answer is to try your ? syntax and see if you get the same result. Your browser should not be getting involved.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Using WWW to load all files in StreamingAssets directory 2 Answers
How to use the file protocol with the WWW class? 1 Answer
android app: load a local image into texture by WWW class 0 Answers
refresh a cached texture? 0 Answers