在cordova ionic中减少从冷启动开始的加载时间 [英] Decrease loading time from coldstart in cordova ionic

查看:31
本文介绍了在cordova ionic中减少从冷启动开始的加载时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ionic创建了一个cordova应用程序,当我从冷启动打开我的应用程序时,

I have created a cordova app using ionic, When i open my app from coldstart,

它首先加载启动画面,然后当我的 index.html 文件加载时屏幕变为白色,然后加载并显示应用程序 UI.这在 Moto X 上大约需要 10 秒,这太长了,因为我的应用包含速度至关重要的功能.

It first loads the splash screen, then there are a few seconds when the screen is white as my index.html file loads and then the app UI is loaded and displayed. This takes approximately 10 seconds on a Moto X which is too long since my app contains features in which speed is of the essence.

从冷启动加载过程中没有发生网络请求.

There is no network request that takes place during the loading from coldstart.

是否有任何优化技术可以减少加载时间,使应用加载速度与 Gmail 等其他混合应用一样快.

Is there any optimization techniques that can decrease the loading time to make the app load as fast as other hybrid apps like gmail.

推荐答案

关于这个主题的信息很多,我会尽量列出一些可能感兴趣的.关于 Cordova 启动时间:

There is a lot of information about this topic, I'll try to list some that might be of interest. About Cordova startup time:

  • PhoneGap for Enterprise 的作者 Kerri Shotts 给出了 这里是一个很好的答案 类似的问题.虽然它已经有大约 2 年的历史,但提到的要点仍然适用.Kerri 在这里触及了一个重要问题:您无法 100% 控制加载时间,请记住这一点!
  • Christophe Coenraets 获得了一些关于此主题的幻灯片以及一些一般性提示和具体例子.
  • (微软关于 Cordova 性能的提示可以在 here.遗憾的是没有关于启动时间的信息,所以我会把它放在大括号中.)
  • Kerri Shotts, the author of PhoneGap for Enterprise gave quite a good answer here on a similar question. Although it's already ~2 years old, the points mentioned still apply. Kerri is touching a vital issue here: You don't have 100% control over the load time, keep that in mind!
  • Christophe Coenraets has got some slides about this topic with some general tips and concrete examples.
  • (Microsoft's tips on Cordova performance can be found here. Sadly there's no info on startup times, so I'll put it in braces.)

Ionic 建立在 Angular 之上,所以我们也来看看它.关于 Angular 启动时间:

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

  • 我在这里有两个链接:最后,它归结为衡量您的表现对导致您的应用启动缓慢的任何原因采取行动.请参阅此处此处.
  • 另一件需要注意的事情是ng-cloak.你没有提到你是否使用它,而是将它应用到你的整个 body 可能很危险.
  • I've got two links here: In the end, it boils down to measuring your performance and act on whatever causes your app to start slowly. See examples here and here.
  • Another thing to watch out for is ng-cloak. You didn't mention if you use it, but applying it to your whole body might be dangerous.

注意:此列表尚不完整,请随时发表评论或添加内容.

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

这篇关于在cordova ionic中减少从冷启动开始的加载时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆