3

I am trying to cache web page URL beforehand (when application starts, before WKWebView loading), in order to load already cached response data into WKWebView, and in order to have a cached data to show to users even when the application starts in offline mode (no internet connection).

I tried NSURLSession in order to get URL response and data from NSURLRequest, and save this data as HTML string into memory, then load the HTML string into WKWebView. But the problem here is that web view shows only texts (not images etc.). There are bunch of images which need to load into web view as well. Can anyone help me to solve this kind of caching? Thanks in advance!

egor.zhdan
  • 4,555
  • 6
  • 39
  • 53

1 Answers1

0

You best bet is to try using App Cache, which is now supported in WKWebView in iOS 10: https://stackoverflow.com/a/44333359/233602

Andrew Ebling
  • 10,175
  • 10
  • 58
  • 75