0

I have a UIWebView that loads a page (that includes several external css and js files) via loadHTMLString. When I am NOT on wifi, it sometimes takes 10+ seconds to render the html page. I don't know what could be causing it to take so long because 95% of the time it renders within half a second, even though it includes the same external resources as the longer-lasting page loads.

On the requests that take a long time to load, I am logging a message at the end of document.ready in the javascript file, to see when it occurs. It always logs the message immediately, even if the webview has not been rendered yet. So I don't know what could be causing the issue, and i cant reproduce it consistently, so any ideas as to where i might want to direct my attention would be greatly appreciated. Thanks!

D-Nice
  • 4,772
  • 14
  • 52
  • 86

1 Answers1

1

It's likely some external resource is taking an unusually long time once in a while.

You might be able to get information about what's happening by using an HTTP sniffer (like the Charles HTTP Proxy) or using the Safari web inspector on your phone or in the simulator.

You could also turn on the network link conditioner to try and reproduce it more frequently.

Jesse Rusak
  • 56,530
  • 12
  • 101
  • 102