Posts

Post not yet marked as solved
27 Replies
I did what @bigbubble suggested and it worked for me. I am currently restricted to using Xcode 10.3 due to limitations outside of my control in the enterprise. My iPad automatically updated to iOS 13.3 so I needed iOS 13.3 support in Xcode 10.3. So I copied /Applications/Xcode11.3.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2 to /Applications/Xcode10.3.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.3 and all worked well.
Post not yet marked as solved
19 Replies
I ended up implementing a WKURLSchemeHandler for browser requests such as js and css files as they need to be intercepted for authorization purposes. However, it looks like the browser waits syncronously for all the urlSchemeTasks to be completed before the browser renders the page. Do you know if a way to asyncronously load these resources?For example. I download a html page and the html page has custom protocol references for js and css files. These are downloaded in the scheme handler using a URLSession client. But it looks like the browser waits for these files to be downloaded before the html page is rendered. Is that expected?
Post not yet marked as solved
19 Replies
I wrote an NSURLSesstion client as suggested using a dedicated URLCache and useProtocolCachePolicy in the URLSessionConfiguration. The html file successfully loaded from cache each time, both on startup and in app reloads.
Post not yet marked as solved
19 Replies
Hey Eskimo,I tried as you suggested and seeing the same issue. Tested a 12KB html file with 'Cache-Control: max-age=36000000'. Loads from disk on startup, but on subsequent reloads in app, it loads from the network each time.Should I log a bug for this?
Post not yet marked as solved
19 Replies
Does WKURLSchemeHandler support intercepting http/https requests? Doesn't look like it from reading up on this. Think its custom protocols only?
Post not yet marked as solved
19 Replies
Thanks John.I will be removing the query string to allow for client side caching so have removed myself from between the rock and a hard place 🙂The web application is remote and not local so not sure where loadHTMLStirng would come into play here. Your tip on WKURLSchemeHandler is a great one as this may help me overcome the limitations I have with the browser requesting assets such as JS and CSS for example.
Post not yet marked as solved
19 Replies
Thanks Eskimo.I am developing an enterprise application where we are loading a web application into a WKWebView. For performance reasons, I would like the webview to cache resources that have cache control response headers. Resources such as index.html in a single page application for example.Due to some limitations out of my control, I need to bundle the entire web application into index.html so it is effectively one asset being downloaded which has a cache-control header with a large max-age in seconds. This is not for offline viewing, but for faster load times of the web application on subsequent loads.Since you replied to me I have been able to figure out why the the application wasn't being loaded from cache. There is a dynamic query string in the request leading to the browser thinking it is a different endpoint. I have noticed that it loads the web application from disk cache on first load of the web app into WKWebView. But if you try to reload the web applciation into the webview within the application, it does not load from either disk or memory cache, it loads from the network.Do you know why this would be the case?Regards,Fergal.
Post marked as solved
3 Replies
What cache control headers need to be set for WKWebView to cache resources? I tried Cache-Control: max-age=SECONDS and it did not honour that.