Looking at moving a 150 meg game to web GL and I have not started working with Unity 5 yet. The one question I have is when the game is downloaded for the first time is it cached in the local browser so the user does not have to wait for the game to be download every time they want to play. If it is downloaded every time the player could end up waiting several minutes before being able to play the game every time. Or are the methods to allow the game to start up fast and download other levels etc in the background?
To the caching question: You can encourage the person’s web browser to cache the javascript with expires or cache-control headers. These are typically set on the web server itself - if you’re on a shared host running Apache, you can usually plunk a couple items in the .htaccess file that Unity pumps out to get that covered. Note that a risk you run if you set these to large values is that if you publish an update, you’ll have to pull of a couple tricks to get browsers that still have to old version cached (and still think it’s valid) to grab the new one.
On downloading other stuff in the background: I’ve only played with WebGL a bit so far with single levels and don’t know if it splits each level into it’s own large file or whether it does it’s own preloading. If it does use multiple files but doesn’t preload on it’s own, it should be possible to write some javascript on the main page to get the user’s browser to grab the js files in the background. There are also some more exotic methods you can use to get a browser to pregrab stuff (rel=prefetch, rel=subresource, server push on SSL with SPDY, etc), though browser support varies on that stuff.
On Caching:
There is the browser cache, but you have little control over that, and most browsers will cap the size of files it will cache, meaning that unity’s data files will typically not be cached by default.
But, it is also possible to have Unity cache it’s data for you using a custom cache implemented using the HTML5 IndexedDB local storage API. You can enable caching for your main game data files in the WebGL publishing settings, or, if you are using AssetBundles, you can use WWW.LoadFromCacheOrDownload to tell Unity to cache the data.
The downside is that the browser may cap the size of the IndexedDB, or may choose to ask the user for permission to let a web page use it beyond a certain size, which you won’t have any control over.
On streaming data while the game runs:
As on any other platform, you can use AssetBundles to solve this.
Alternatively, you can use this package i made, which will patch the WebGL build process to split up your data file so that levels can be downloaded sequentially, and you can check when the next level is downloaded before progressing: http://files.unity3d.com/jonas/WebGLLevelStreaming.unitypackage (instructions inside).