Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-5212 - Add preference "DiskCache" (enable/disable)
This triggers the native webview caching which may improve app performance
when resources are not expected to change.
  • Loading branch information
bryanhiggins committed Jan 6, 2014
1 parent 9f93e17 commit 37e9fc11cde9dc3670083aa75fb7605326eb0066
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
@@ -587,6 +587,10 @@ function processCordovaPreferences(data, widgetConfig) {
logger.warn(localize.translate("WARNING_WEBSECURITY_DISABLED"));
}

// <preference name="diskCache" value="enable or disable" />
if (preference.diskcache) {
widgetConfig.enableDiskCache = (preference.diskcache === 'enable');
}
}
}

@@ -77,5 +77,6 @@ module.exports = {
enableFormControl: true,
enableChildWebView: true,
enableWebSecurity: true,
enableDiskCache: false,
enablePopupBlocker: false
};
@@ -108,8 +108,12 @@ var _self = {
if (!config.enablePopupBlocker) {
qnx.webplatform.nativeCall('webview.setBlockPopups', webview.id, false);
}
// Workaround for executeJavascript doing nothing for the first time

if (config.enableDiskCache) {
qnx.webplatform.nativeCall('webview.setEnableDiskCache', webview.id, 'true');
}

// Workaround for executeJavascript doing nothing for the first time
webview.executeJavascript("1 + 1");

url = url || config.content;

0 comments on commit 37e9fc1

Please sign in to comment.