hello I have created angular 2 app after successfully compile when I run it to browser it is taking too much time to load when I have checked on networks it is requesting for 14 items and 8 mb downloaded , can someone tell me how to reduce time of it
Asked
Active
Viewed 1,257 times
0
-
Does your server gzip the files? Do you use aot compilation? Do you use the build-optimizer from angular/cli? – Ploppy Oct 02 '17 at 11:17
-
Possible duplicate of [Reduce Angular 2 file size for deployment](https://stackoverflow.com/questions/41976664/reduce-angular-2-file-size-for-deployment) – mxr7350 Oct 02 '17 at 11:19
-
and how to to that – Kalpesh Oct 02 '17 at 11:24
-
after compile all js file size if become more then 700kb – Kalpesh Oct 02 '17 at 11:28
2 Answers
1
2 Things you can directly do:
When you will deploy your app, use: AOT:
ng-build --prod --aot
This will be more optimized.
And next, you can do LazyLoading.
https://angular.io/guide/ngmodule#lazy-loading-modules-with-the-router
But without your code, it will be hard to help more.

Wandrille
- 6,267
- 3
- 20
- 43
0
please check you project size and theme assets size it is also matters as u said 14 items and 8 mb downloaded means some js are being download on load project so it is taking time so first delete extra sutff from your project if you are using these just put only required, pages, images, js, etc which are used in your project

Manoj Meria
- 586
- 6
- 13