前端性能优化(五)传输加载优化 一.启动压缩Gzip 1.在传输阶段进行体积压缩,可高达百分之90% 2.如何配置Nginx启用Gzip 二.使用keep-alive 三.http缓存 四.使用http2 一.启动压缩Gzip 1.在传输阶段进行体积压缩,可高达百分之90% 2.如何配置Nginx启用Gzip 如何配置Nginx启用Gzip 首先 下载homebrew 然后 安装nginx brew install nginx 然后 sudo brew services start nginx 开启服务 然后 vim /usr/local/etc/nginx/nginx.conf 查看配置文件 会查看到默认端口8080