We are trying to create a WKWebView in the background on application launch so that we can improve the speed and load times of WKWebViews when the user accesses a feature/URL later on. Basically trying to pre-fill the local cache with a few larger CSS and JS files so that later we get these from the cache improving speed.
Even though we carefully use the same WKProcessPool for both the invisible pre-load WKWebView and the later WKWebViews we end up missing the cache subsequently when accessing a real web page in our app. The pre-load WKWebView is definitely downloading the resources (we are checking traffic via a web proxy), and the resources have the correct "Cache-Control: max-age=" HTTP header. The pre-load WKWebView seems to operate normally and download everything ... we just can't get later WKWebViews to locate anything in the cache. Both the dummy pre-load end point and the application URLs are on the same domain (www.domain.com).
Anyone else have success pre-fetching in this manner? Is there some key we are missing in configuring/creating WKWebViews and how they use a common cache?