iPhone UIWebView slow loading to local HTML files

前端 未结 7 1468
无人及你
无人及你 2021-02-01 03:47

I\'m developing an app that requires caching web pages (completely) along with their CSS files and images after saving the entire HTML of the page (going through the links to st

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 04:33

    Is your solution actually cache things other than the html file, meaning pictures, css, etc, AND relinking them in the html page? I am guessing that you are downloading and caching the html page and external resources then the UIWebView is loading that html and still going out to load the external resources. That would explain the fast performance on the simulator and the slower performance on device.

    Here is a library designed to do exactly what you are trying to do: ASIWebPageRequest.

    It should also be noted that it could simply be a case of disk i/o bottlenecking. I know on my project, I was loading large images in a uitableview and even after they were cached I noticed quite a bit of lag when pulling them off the disk because they were so big.

提交回复
热议问题