We are using the WKWebView for our Net page display frame,even if I set the NSURLRequest cache policy ,when it jumping ,the NSURLRequest cache policy still default to 0,how can I fix that problem?
NSURLRequest * urlReuqest = [[NSURLRequest alloc]initWithURL:url cachePolicy:1 timeoutInterval:30.0f];
//Before request, I set the NSURLRequest cachePolicy To 1
if(iOS8){
[(WKWebView *)_realWebView loadRequest:urlReuqest];
}
when I load the page, I catch the NSURLRequest cachePolicy in WKNavigationDelegate method implement
- (void)webView:(WKWebView *)webView
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler{
NSLog(@"requestCachePolicy:%lu",(unsigned long)navigationAction.request.cachePolicy);
decisionHandler(0);
}
and the console shows requestCachePolicy:1,as I set before
however ,When I click on a link and jump to another net page,I catch the cachePolicy in the same WKNavigationDelegate method
the console shows requestCachePolicy:0 ,the cachePolicy is turn to default cachePolicy but not I set up before
How to change the WKWebview request cachePolicy When the net page jump?