简体   繁体   English

如何加快 Angular 的启动速度?

[英]How To Speed Up Angular Startup?

I'm working on angular application, but when I build it and hosting on server it take about 3-5 minutes to start the app?!!!我正在开发 angular 应用程序,但是当我构建它并托管在服务器上时,启动应用程序大约需要 3-5 分钟?!!! so how can I fix this issue and speed up angular start up?那么如何解决此问题并加快 angular 的启动速度?

We were facing the same issue.我们面临着同样的问题。 Here are couple of things that I did to improve the performance of Angular App:以下是我为提高 Angular App 的性能所做的几件事:

  1. Improve images loading time images consumes most of the time while page loading so images should be compressed.提高图像加载时间图像在页面加载时消耗大部分时间,因此应该压缩图像。 I developed on the fly image compression system in AWS to handle this.我在 AWS 中开发了动态图像压缩系统来处理这个问题。 https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/appendix-d.html https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/appendix-d.html

  2. Use change detection strategy on push in most of your components在大多数组件中使用推送更改检测策略

  3. Unsubscribe your observables取消订阅你的 observables

  4. Use async tag js script tags in index.html在 index.html 中使用异步标签 js 脚本标签

  5. use pagination or infinite scroll loading in application在应用程序中使用分页或无限滚动加载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM