其他分享
首页 > 其他分享> > angular前端加载问题

angular前端加载问题

作者:互联网

1.增加分析报告

package.json增加如下配置

"build": "node --max-old-space-size=15000 \"node_modules/@angular/cli/bin/ng\" build --prod --aot   --vendor-chunk=false --build-optimizer --output-hashing=all --base-href /ceshi/  --source-map --stats-json ",
"bundle-report": "webpack-bundle-analyzer ceshi/stats-es2015.json"

先运行npm run build 再运行npm run bundle-report

2.服务端apache开启gzip

httpd.conf增加

LoadModule deflate_module modules/mod_deflate.so

<IfModule mod_deflate.c>

# 设置压缩类型

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE image/svg+xml

AddOutputFilterByType DEFLATE image/x-icon

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

<IfModule mod_headers.c>

# 自定义Header

Header append Vary User-Agent

Header append Powerd-By XXXXX

</IfModule>

</IfModule>

 

标签:xml,--,text,前端,DEFLATE,application,angular,AddOutputFilterByType,加载
来源: https://www.cnblogs.com/chinadba/p/16263952.html