1

I have created Angular Application and split the single module into a bunch of smaller feature modules and lazy load them.And removed unnecessary scripts and styles from index.html and load it at component levels. After final deploy files First time loading time is too slow,

i have tried with --prod now the file size is around 3MB is there any other possible to speed up

Below is the screen shot of my build file size enter image description here

Yogendra Chauhan
  • 805
  • 5
  • 15

1 Answers1

1

Speed Optimization does not only depends on lazy-loading.

If you are sure that you optimized your code, removed unnecessary imports, styles, scripts, then you must apply other solutions like:

  • Make all child routes as lazy loading.
  • Server Side Rendering with Angular Universal
  • Serve pre-compressed contents from your server. If you deployed it with Nginx, you can enable Gzip compression.
  • Update cache policies for static assets. This also should be configured from server side.
  • Image Lazy loading. If you have several images on the first page, you load only visible image at first and load others on scroll. You can find an Angular module for that.
  • Load external scripts only when they are needed.

There are more techniques can be applied for speed.

You can test your app with Lighthouse or GTmetrix. The tools will suggest you solutions to apply and you can just follow them.

critrange
  • 5,652
  • 2
  • 16
  • 47