2

ng build --prod --aot takes my vendor.bundle from 1mb to 244kb but how do I serve my website/users using the gzipped .bundle instead of the full sized version?

I thought this happened automatically but when I ran google PageSpeed developer tools they said that I need to enable compression to optimize my site:

Compressing resources with gzip or deflate can reduce the number of bytes sent over the network. Enable compression for the following resources to reduce their transfer size by 1.4MiB (76% reduction). Compressing vendor.39b8a9cf298d72758de0.bundle.js could save 1.1MiB (76% reduction).

seanEd
  • 1,001
  • 1
  • 16
  • 29
  • 1
    I guess you have to enable gzip compression on your server e.g http://stackoverflow.com/questions/15999606/enable-gzip-compression-with-nginx – yurzui Feb 23 '17 at 05:24
  • What are you using for your web server? In ASP.NET Core there is a middleware to serve up the already compressed verions (https://github.com/AnderssonPeter/CompressedStaticFiles). There is likely something like this for any server you would use. – Luke Mar 07 '17 at 05:09
  • node express server – seanEd Mar 07 '17 at 21:21

0 Answers0