How to speed up loading of Android WebView when page served from AppsScript and CAJA?

1.2k Views Asked by At

I have an AppsScript UI which loads in 2 - 3 seconds via my windows laptop in Chrome. When attempting to load the same UI via an Android App in a WebView the load takes 27 seconds. Using a New (2013) Nexus 7 running Android KitKat 4.4 (SDK version 19).

I don't know how to speed up the loading. I am following all the best practices posted on the AppsScript site (using CacheService e.t.c) and can think the issue must be the Android App/Webview?

In Android the initial page load takes 13 - 14 seconds, then I have a loading screen while a content script retrieves data for a further 13 - 14 seconds. On my laptop the initial page load takes 1 seconds then has a loading screen while a content script retrieves data for a further 1 - 2 seconds.

I have used the Chrome remote debugging tools and can be sure there is no difference in the number of resources being retrieved. Am running out of ideas on how to speed up the loading. Any advice appreciated!

1

There are 1 best solutions below

0
On

If you haven't already, you might want to try native sandboxing (see https://developers.google.com/apps-script/guides/html/best-practices#use_native_sandboxing):

var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
output.setSandboxMode(HtmlService.SandboxMode.NATIVE);