Hi,
I am loading a resource from a remote server and rendering its content in a WKWebView instance. I am configuring URLRequest object with a cachePolicy of .useProtocolCachePolicy and using the load(request:) method on the webview instance.
The remote resource has a response header of Cache-Control: max-age=31536000. Yet the webview does not honour this cache policy. It always redownloads the remote resource.
What other configurations are needed to ensure the resource is cached and persisted to disk for future cached loading? I see WKWebView uses a WKWebsiteDataStore object to persist cache. Is there something I need to configure there to get it to cahce correctly?
Am I right in saying that WKWebView does not use the shared URLCache?
Thanks!