问题
I am building a simple app with Ionic. But my app has a performance issue with initial loading time on cold start.
Here is what I have done:
- collection-repeat instead of ng-repeat with 'track by'
- native scroll:
overflow-scroll='true'
- use no cache with
$ionicConfigProvider.views.maxCache(0);
I cannot use crosswalk-webview
because of one of the library I am using.
I feel like all I have done is to improve ionic performance that is not really related with initial loading.
Any advice or suggestion would be appreciated.
回答1:
Without seeing your code, ionic and dependencies versions, and some output, it's hard to tell exactly. However, updating to the most recent version of Ionic Cloud and building with the production flag reduced my cold start load time from 20+ seconds to under 4 seconds.
npm install @ionic/cloud-angular@latest --save
ionic build --prod
It will take longer to build but you'll have a much faster cold start time.
来源:https://stackoverflow.com/questions/40120718/ionic-initial-loading-time