Cordova iOS - WkWebView offline


February 2019


102 time


Application cache is deprecated which means we'll need to switch to service worker but I've done research it was mentioned..

1) "It is not possible to use a ServiceWorker in a Cordova app because the ServiceWorker API is not available to WKWebView and is not implemented in UIWebView. It is available in Safari on iOS, but not WKWebView." //

2) Enabling appcache using private api is not working //Enable Application cache in WKWebView

3) Cordova file & file-transfer plugin is not even recommended to use for production.

Is there any alternatives to be able to store artifacts (html, js & css files) and load for offline used? Our application needed to cached 300-400 files.

Appreciate your suggestions in advance! (:

1 answers


Well to answer your question, my suggestion would be this: Get rid of those 400 files and find a more practical way to replace them.

Exactly why would you need to store so much CSS files in a Cordova app anyway? There's no logical reason that I can think of. Nor practical, loading other HTML files in the WebView goes against the SPA design principle.