5

I am working on an application I have made deployment of my application now the issue I am facing is some of my prod files taking too much time load here is the screenshot from my network tab. I have also tried --aot and optimizer command while making prod build How to overcome this?

enter image description here

Kamran Khan
  • 1,042
  • 10
  • 21

2 Answers2

5

First approach is to have your production server serve gzipped files. This will considerably reduce load time. How you do this depends on your server, not on Angular.

The second (complementary) approach is to reduce your Angular bundle size. There are a million ways of doing that, not least by implementing lazy loading wherever possible

Will Alexander
  • 3,425
  • 1
  • 10
  • 17
3

I would suggest using npm package gzipper

  1. Run npm install -g gzipper to install gzipper globally
  2. Run ng build --prod or your build script in angular project
  3. Run gzipper compress ./dist to compress the files in dist folder

Note: Enable gzip compression on server end

RS Roshi
  • 53
  • 1
  • 6