2019.3 wasm caching and chrome

Hi,

I recently made a build for webgl using the option “WebAssembly Streaming”.
It work well on every browser I tested.

But when I updated the build (and so updated the “wasm” file), Chrome did not reload it from the local server but each time retrieve it from cache instead and even when I use the Shift + f5 to force refresh with no cache.
On other browser this work as expected, they detect wasm file has changed and dowload it again.

When I use chrome in private mode or if I manually modify the name of the wasm file, then Chrome download it and the app works well, so it’s clearly related to the cache.

I also join you two screenshot of the network tool of Chrome that show for each files if they were dowloaded from cache or not.
When I press F5 only we see that almost all the files are retrieved from the disk cache:
6628942--755740--WasmWithoutForceRefresh.JPG

When I press Shift + F5 we can see every files are downloaded except for the wasm file that still retrieved from disk cache
6628942--755743--WasmForceRefresh.JPG

Is this problem come from Unity build? or Chrome?

More info:
Unity version: 2019.3.13f1
Chrome version: 87.0.4280.88

If on player settings “data caching” is active. Unity will use cached file. Chrome didn’t cache this file.

Ok thanks for the information @AgnosiaGames .
So in this case the bug comes from Unity side but only on Chrome, this is weird

1 Like

I finally understood that the build settings “data caching” should be disable to let the server/browser cache work as expected.
I was assuming if data chaching was disable it was reloading from server each time, but absolutly not. As @AgnosiaGames pointed it out when this option is enable it’s unity that handle the caching file. In some case this is what we want but not in general.

More info about how work the cache settings can be found here: WebGL Settings Data caching?

1 Like