1、GOP S 全 球 运 维 大 会 2019上 海 站GOP S 全 球 运 维 大 会 2019上 海 站HTTP性能极限优化GOP S 全 球 运 维 大 会 2019上 海 站目录编码效率优化1信道利用率优化2传输路径优化3信息安全优化4GOP S 全 球 运 维 大 会 2019上 海 站 HTTP/1 whitespace-delimited HTTP/2 二进制FrameHTTP消息格式的演进方向:性能!HTTP1991 HTTP/0.91992 HTTP/1.01996 HTTP/1.12009 SPDY Websocket2015 HTTP/220 xx HTTP/3GOP S
2、 全 球 运 维 大 会 2019上 海 站 为何要做压缩?数据=信息+数据冗余 无损压缩:Nginx实时压缩:ngx_http_gzip_module过滤模块:gzip on;ngx_http_brotli_filter_module过滤模块:brotlion;Nginx预压缩:ngx_http_gzip_static_module处理模块:gzip_staticon;ngx_http_brotli_filter_module处理模块:brotli_staticon;有损压缩:图片或者视频 Nginx缩略图:ngx_http_image_filter_module模块 image_filte
3、r选择压缩方式:无损压缩与有损压缩GOP S 全 球 运 维 大 会 2019上 海 站GOP S 全 球 运 维 大 会 2019上 海 站GOP S 全 球 运 维 大 会 2019上 海 站Huffman静态表动态表HTTP头部压缩的集大成者:HPACKGOP S 全 球 运 维 大 会 2019上 海 站常用HTTP头部的简化编码:HPACK静态表IndexHeaderNameHeaderValue1:authority2:methodGET3:methodPOST4:path/5:path/index.html6:schemehttp7:schemehttps8:status2009
4、:status20410:status20611:status30412:status40013:status40414:status50015accept-charset16accept-encodinggzip,deflate17accept-language18accept-ranges19accept20access-control-allow-originIndexHeaderNameHeaderValue21age22allow23authorization24cache-control25content-disposition26content-encoding27content
5、-language28content-length29content-location30content-range31content-type32cookie33date34etag35expect36expires37from38host39if-match40if-modified-sinceIndexHeaderNameHeaderValue41if-none-match42if-range43if-unmodified-since44last-modified45link46location47max-forwards48proxy-authenticate49proxy-autho
6、rization50range51referer52refresh53retry-after54server55set-cookie56strict-transport-security57transfer-encoding58user-agent59vary60via61www-authenticatedGOP S 全 球 运 维 大 会 2019上 海 站适合HTTP头部的静态Huffman编码GOP S 全 球 运 维 大 会 2019上 海 站 RFC2397:Data URI scheme BASE64编码的小文件嵌入CSS或者HTMLHTTP资源的编码也需要优化!=WebPack打