How does the unity webplayer handle caching?

How does the unity webplayer handle caching of the unity3d files in the following situations

  1. When a build is published as “Web player”.

  2. When a build is published as “Web player streamed”

  3. When unity3d files are downloaded using the WWW class.

  4. Any other situations that I don’t know about.

Specifically I’d like to know where the cache lives on the local filesystem (windows and mac), and what the caching strategy is (e.g. just uses Last-Modified), and if the caching strategy is under the control of the browser (which I think it is in 1), or under the control of the unity web player.

As of version 2.5, Unity does not have any built-in caching mechanism. A brower might implement some caching stragtey in theory, but I’m not aware of any browser doing that with the unity plugin.

Jonas thanks for the reply but I’m a bit unclear about what you mean but having no caching.

Perhaps a specific example would make it clearer. If I execute the example from the scripting manual

var stream = new WWW ("http://www.unity3d.com/webplayers/Lightning/lightning.unity3d");
// Yield until stream is done
yield stream;
// Load it!
stream.LoadUnityWeb();

then it downloads lighting.unity3d from the server and presumably puts it somewhere on the file system (where?) before loading it into memory.

Are you saying that if I repeat the commands above then lightning.unity3d will be downloaded again even when lightning.unity3d has not changed on the web server?

Let’s clarify things a bit:

  • Unity content will be cached like any other web content using the browser’s cache. As such you cannot really count on permanent caching here as the user may clear their cache, view other content flushing yours from the cache, so it’s all quite volatile but falls in line with the standard browser caching behavior that’s been around for years.

  • Jonas correctly stated that the Unity Web Player itself doesn’t offer you a cache to store data on its own.

So, how does the web player handle caching? It doesn’t, it relies on the browser and its standard caching behavior.

This answer is a bit old.
Any news about Webplayer caching ?

Works the same as far as I’m concerned. Just force the browser to refresh either via meta or other means, like flash and anything else. Unity has playerprefs if you want to save data to the user locally.

For long term storage, php sql