Saving Downloaded Assets Locally

Hey there,

I’m doing some research before a project starts, and I am trying to work out what is possible.

The project will run in a webview within a native application. I wanted to know if it’s possible to save/store loaded assets locally after they have been downloaded and then reload them instead of redownloading them when ever the game starts up. The ultimate goal is to reduce the load time each time the game loads.

If anyone can point me into the right direction to explore this further that would be super helpful!

Thanks!

That sounds like something you need to do in your native app as it’s not a feature that PlayCanvas engine supports natively.

The alternative is to package all the assets with your app and serve within your app rather than from a server.

1 Like

I wonder whether the web view cache will provide that for you?

Although you might need to play with the http response headers related to caching, and also the cache related settings of the native webview class.

In one project, not playcanvas related, I had an iOS app that contained a WKWebView and it was caching web content between app launches. The problem I had was the a javascript file was being loaded from the cache and not fetching the latest from the server. I had to add a query param to the file URL to force the latest to be fetched from the server.

1 Like