2
votes

My app is much faster when I reuse the same WKWebView for new navigations (but I would love to be able to create new WKWebViews for each navigation so I can maintain a ViewController stack).

I've noticed however, that the pages load slower when I create a new WKWebView for each page. Somehow, Safari's (open link in new tab) seems to be doing the same thing (if I inspect through Xcode, I see a new WebContent process for each tab) but it still is about the same speed as loading the page in place in the same webview.

Besides using the same process pool, is there anything I can do to speed up load times for pages that load in a new WKWebView?

1

1 Answers

1
votes

I am currently working with WKWebViews as well and as far as I can tell there is no way to optimise them. I don't really think that they are loading slower per se, I guess iOS just takes its time when creating each WKWebView thread.

And if we continue this line of thought, it stands to reason that Apple just has a much faster way of creating/"starting" the views themselves inside Safari. But I do think that load times of pages are the same once the view is set up, which sort of proves my point.

At least that's what I have seen with my app so far.