Changing Cordova Plugin Download Behavior to Speed ​​Up Download

I am looking for a way to speed up the loading of plugins in Cordoba so that I can show my user interface as early as possible (the user interface does not require the strict need for all plugins on first launch).

What I have tried so far:

  • According to the documentation, I tried to add: <param name="onload" value="false" />; for every function I load. Does not help. ( Related SO request )

  • Moved the application initialization code from deviceReady(no specific Cordoba bits are required for initialization).

How did I conclude that plugins are a bottleneck? As below:

  • I removed all the plugins needed for the application (23 of them!), And the download time was shaved off by 2.5-3 seconds. Therefore, I am sure that this is a bottleneck.

  • In addition, I removed all JS and CSS, including cordova.js, and loaded an empty HTML page. With plugins and without plugins. The difference was huge.

In general, the problem is that until all of the plugin’s own code is launched, the WebView itself will not appear. More plugins, more time it takes to be visible. Is there a way to let Cordoba load WebView right away and let JS load when it initializes plugins in the background and fires deviceReadywhen necessary? I can do some things in Cordoba at a later moment.

on this topic:

+4
1

, turnip.

onload=false <feature (...)> . № 12.

, , , , .

Cordova/Phonegap WebView ( Android , .). : , Javascript , -. Javascript ( ) ( ). , HTML (, , ); CSS, , ( ).

, , CSS, - CSS . , - ( , ).

, , , , soo long. * some * , , . , (GPS) 10 , .

  • , , , .
  • init. - , .

, , , , ; .

, * - , , , . Cordova, Phonegap, Android Apple iOS.

, Cordova/Phonegap

+2

Source: https://habr.com/ru/post/1613011/


All Articles