Reduce cold start loading time in the ion core

I created a cordova application using ionic, When I open the application from coldstart,

First, it loads the splash screen, and then a few seconds when the screen is white, when the index.html file is loaded, and then the user interface of the application is loaded and displayed. It takes about 10 seconds on the Moto X, which is too long since there are functions in my application in which speed makes sense.

There is no network request that occurs during boot from a cold start.

Are there any optimization methods that can reduce the download time so that the application loads as fast as other mashups like gmail.

+5
source share
2 answers

There is a lot of information in this topic, I will try to list some of them that may be of interest. About Cordoba launch time :

  • Kerri Shotts, the author of PhoneGap for Enterprise, gave a good answer here on a similar issue. Although it is already ~ 2 years old, the points mentioned still apply. Kerry addresses a vital issue: You do not have 100% control over boot times , remember that!
  • Christophe Coenraets has some slides about this topic with some general tips and case studies.
  • (Microsoft's performance tips for Cordoba can be found here . Unfortunately, there is no launch time information, so I'll put it in braces.)

Ionic is built on top of Angular, so let's also take a look at it. About Angular startup time :

  • I have two links here: in the end, it comes down to measuring the effectiveness and actions that make your application start slowly . Examples here and here .
  • Another thing to look out for is ng-cloak . You did not mention if you use it, but applying it to the whole body can be dangerous .

Note. This list is far from complete, feel free to comment or add material.

+9
source

A building with a production flag will minimize and compress all ionic outputs, as well as remove any unnecessary outputs and logging that are used for development.

 ionic build --prod 

"This will reduce your application code as a source of ionics, and also remove any debugging features from the APK. This is usually used when deploying the application to the Google Play Store." - Ion documentation Also applicable to any other deployment platform.

This will take longer, but you will have a much faster cold start time.

You can also specify the production flag when creating on a specific platform.

 ionic build [platform] --prod 
+1
source

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


All Articles