移动端IM研发者必读(三):爱奇艺移动端跨境弱网通信的优化实践
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">本文由爱奇艺技术团队分享,作者isno,原题“爱奇艺海外App的网络优化实践”,下文进行了排版和内容优化等。</span></span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">1、引言</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">做海外市场,<span style="color: black;">尤其</span><span style="color: black;">目的</span>是面向<span style="color: black;">全世界</span>的用户,网络的重要性<span style="color: black;">不问可知</span>。试想一个移动端应用,<span style="color: black;">例如</span>即时通讯IM,聊天<span style="color: black;">信息</span>的本质<span style="color: black;">便是</span>人跟人在说话,一条<span style="color: black;">信息</span>从发送到接受需要10秒的时间,这恐怕会让用户崩溃,随之<span style="color: black;">便是</span>被无情地卸载,开拓海外市场那<span style="color: black;">便是</span>做梦了。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">这次</span>分享的<span style="color: black;">文案</span>内容,基于爱奇艺面向<span style="color: black;">全世界</span>用户推出的国际版,在海外<span style="color: black;">跨境</span>网络环境<span style="color: black;">繁杂</span>的前提下,针对性地做了一系列弱网优化实践,取得了不错的效果,<span style="color: black;">这里</span>总结分享<span style="color: black;">咱们</span>的<span style="color: black;">有些</span>做法和优化思路,<span style="color: black;">期盼</span>对你有所<span style="color: black;">帮忙</span>。</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">总结下来,<span style="color: black;">跨境</span>弱网优化实践的几个核心<span style="color: black;">便是</span>:</span></strong></p><strong style="color: blue;"><span style="color: black;">1)</span></strong><span style="color: black;">能不请求网络就不请求;</span><strong style="color: blue;"><span style="color: black;">2)</span></strong><span style="color: black;">请求的链接<span style="color: black;">目的</span> 0-RTT;</span><strong style="color: blue;"><span style="color: black;">3)</span></strong><span style="color: black;">请求的内容越小越好。</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">正文内容<span style="color: black;">咱们</span>将逐个技术点展开了分享。</span></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/1278db23b47a49fa84e76c8ef7304ccf~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=k22cW%2Fuewu9Z36RPM8G9LN5nnCs%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">2、系列<span style="color: black;">文案</span></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">本文是系列<span style="color: black;">文案</span>中的第 </span></strong><strong style="color: blue;"><span style="color: black;">3</span></strong><strong style="color: blue;"><span style="color: black;"> 篇,本系列<span style="color: black;">文案</span>的大纲如下:</span></strong></p><span style="color: black;">《移动端IM<span style="color: black;">研发</span>者必读(一):通俗易懂,理解移动网络的“弱”和“慢”》</span><span style="color: black;">《移动端IM<span style="color: black;">研发</span>者必读(二):史上最全移动弱网络优化<span style="color: black;">办法</span>总结》</span><span style="color: black;">《移动端IM<span style="color: black;">研发</span>者必读(三):爱奇艺移动端<span style="color: black;">跨境</span>弱网通信的优化实践》(* 本文)</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">倘若</span>您是IM<span style="color: black;">研发</span>初学者,<span style="color: black;">剧烈</span><span style="color: black;">意见</span><span style="color: black;">首要</span>阅读《新手入门一篇就够:从零<span style="color: black;">研发</span>移动端IM》。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">3、 <span style="color: black;">跨境</span>弱网样本摸底</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在 App 初期版本内<span style="color: black;">增多</span>请求链路的采样。样本数足够的<span style="color: black;">状况</span>下,<span style="color: black;">能够</span>清楚你要推广的市场是<span style="color: black;">怎么样</span>的环境。样本数据让<span style="color: black;">咱们</span>清楚<span style="color: black;">发掘</span>了各个国家、地区网络的问题,在大规模宣传和投入前,做好 App 的<span style="color: black;">基本</span>工作非常重要。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">海外用户至海外数据中心的网络延迟</span></strong><span style="color: black;">(这是监测节点数据,用户端延迟更高):</span></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/625c622919d34a39a9dd3d6cf4d391e1~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=tG6AzKzlKxoCMCSBShYmzPpQLKs%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">海外<span style="color: black;">重点</span>国家、地区移动网络<span style="color: black;">状况</span>:</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/e5acf185a9a24a6c919b71c93cbf1709~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=h6Na8SK46eC6k5LBDi%2F4XgjwsIs%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">这些问题<span style="color: black;">重点</span>是:</span></strong></p><strong style="color: blue;"><span style="color: black;">1)</span></strong><span style="color: black;">运营商劫持严重,DNS 劫持、HTTP 劫持;</span><strong style="color: blue;"><span style="color: black;">2)</span></strong><span style="color: black;">移动端网络<span style="color: black;">繁杂</span> ,东南亚的网络<span style="color: black;">基本</span>建设还待改善;</span><strong style="color: blue;"><span style="color: black;">3)</span></strong><span style="color: black;">低端 Android 机有<span style="color: black;">必定</span>的占比,数量级别影响决策;</span><strong style="color: blue;"><span style="color: black;">4)</span></strong><span style="color: black;">国际网络用户端到服务器的延迟高。</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在初期<span style="color: black;">周期</span>,技术工作的核心是<span style="color: black;">处理</span>以上问题,为后续的运营做好<span style="color: black;">基本</span>建设。<span style="color: black;">由于</span>业务接口大部分为 HTTP 形式,就<span style="color: black;">起始</span>围绕 HTTPS 进行针对性改进。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">一个HTTPS请求<span style="color: black;">周期</span>分析:</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/32dbd611dda94e44914cba86a16ba9bf~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=la48D69JxVQOSKYhJ15RVJiUi2k%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">1RTT(DNS)+ 1RTT(TCP 握手)+ 2RTT(TLS1.2)+ 1RTT(HTTP 链接)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">倘若</span>以端到服务 50ms 延迟为例:</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">一个 HTTPS 的接口延迟 = 350ms = 50*5+ 100ms(服务端)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">倘若</span><span style="color: black;">目的</span>是一个非国内用户,打开首页需要 1.1s, 这个时间显然有点长。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">下面<span style="color: black;">起始</span>进行技术改进的正文,以下是概括技术性优化的关键点:</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/f9320be0f5ca4e79bfd4e27c5440423b~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=x6PANzJeCeMaEzf54sZ5J%2B1lNFo%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">4、<span style="color: black;">基本</span>链路的改进优化</h1>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">4.1DNS 优化<span style="color: black;">调节</span></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">DNS 的解析改为 HTTPDNS,DNS 的改进上线后观察初始连接请求<span style="color: black;">提高</span> 17% 的效率。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">目的<span style="color: black;">重点</span>是:</span></strong></p><strong style="color: blue;"><span style="color: black;">1)</span></strong><span style="color: black;"><span style="color: black;">处理</span>域名劫持问题 (东南亚地区回传的数据<span style="color: black;">表示</span>有不少劫持);</span><strong style="color: blue;"><span style="color: black;">2)</span></strong><span style="color: black;"><span style="color: black;">处理</span> LocalDNS 非就近分配问题;</span><strong style="color: blue;"><span style="color: black;">3)</span></strong><span style="color: black;">结合业务<span style="color: black;">能够</span>做解析预热。</span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">4.2传输层的优化<span style="color: black;">调节</span></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">MTU 的问题 :</span></strong></p><strong style="color: blue;"><span style="color: black;">1)</span></strong><span style="color: black;">Client 端和 Server 端<span style="color: black;">区别</span>的 MTU 值会<span style="color: black;">引起</span>丢包率过高。AWS 某些场景实例默认巨型帧:MTU 是 9001,但接收端默认 1500,<span style="color: black;">此时</span>候就会<span style="color: black;">显现</span><span style="color: black;">有些</span>丢包的现象;</span><strong style="color: blue;"><span style="color: black;">2)</span></strong><span style="color: black;"><span style="color: black;">倘若</span>你用了多个云商服务,用 VPN 组网,IP隧道封装的数据临界 1500,又会<span style="color: black;">导致</span>丢包、包重传问题;</span><strong style="color: blue;"><span style="color: black;">3)</span></strong><span style="color: black;">最严重的<span style="color: black;">状况</span>:部分网络封杀 ICMP 协议,<span style="color: black;">引起</span> MTU <span style="color: black;">没法</span>自动协商。</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">TCP 拥塞<span style="color: black;">掌控</span>优化:</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">拥塞窗口 CongWin 是未接收到接收端确认<span style="color: black;">状况</span>下连续发送的字节数; 。CongWin 是动态<span style="color: black;">调节</span>,取决于带宽和延迟的积,<span style="color: black;">例如</span> 100MB 的带宽 100ms 的延迟环境。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">时延带宽积 = 100Mbps*100ms = (100/8)*(100/1000) = 1.25MB</span></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">理论上 CongWin 窗口<span style="color: black;">能够</span>最大化到 1.25MB。CentOS 默认CongWin = 20*MSS,在 29KB <span style="color: black;">上下</span>,离上限 1.26MB 差太多了,默认值上调TCP的<span style="color: black;">起步</span>会更快。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">TCP 快速打开</span></strong><span style="color: black;"> (TCP Fast Open:TFO):</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">TCP 的 keepalive 下依然会有链接断掉重建的<span style="color: black;">状况</span>,TFO 是针对这种<span style="color: black;">状况</span>的优化。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">TFO 的原理机制:</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/e18acfde26db4af8aedeff04282ed6c7~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=QBwWAa2xmhnZ%2BaMv6aHsxJ8JRdc%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">5、应用层的改进优化</h1>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">5.1HTTP 的优化</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">HTTP1.1 有个 keep-alive <span style="color: black;">功效</span>是复用 TCP 链接,减少新建的消耗,<span style="color: black;">针对</span>浏览器的业务比较适用,但<span style="color: black;">针对</span>移动端这种时间分散的请求,大部分请求还是新建连接。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">HTTP1.1 的串行机制有头部阻塞的问题。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">5.2SSL 层优化</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">尽可能</span>升级到 TLS1.3(<span style="color: black;">微X</span>的TLS1.3实践:《<span style="color: black;">微X</span>新一代通信安全<span style="color: black;">处理</span><span style="color: black;">方法</span>:基于TLS1.3的MMTLS详解》),利用 Pre-shared Key 机制,开启 ssl_early_data <span style="color: black;">能够</span>进一步优化 “0-RTT ”,<span style="color: black;">倘若</span><span style="color: black;">没法</span>升级 TLS 版本,优化密钥算法为 ECDHE,运算速度快,握手的<span style="color: black;">信息</span>往返由 2-RTT 减少到 1-RTT,能达到与 TLS1.3 类似的效果。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">TLS 版本的区别:</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/88d2c28d10984becb94a759562713abb~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=HpmZQQS5qxwRVYlfTFEBzDxm9YA%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">5.3升级 HTTP2.0</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">几个重要的改进点:</span></strong></p><strong style="color: blue;"><span style="color: black;">1)</span></strong><span style="color: black;">分帧传输;</span><strong style="color: blue;"><span style="color: black;">2)</span></strong><span style="color: black;">多路复用;</span><strong style="color: blue;"><span style="color: black;">3)</span></strong><span style="color: black;">头部压缩。</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">多路复用:</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在 HTTP/2 中,两个非常重要的概念:帧(frame)和流(stream)。帧<span style="color: black;">表率</span>着最小的数据单位,<span style="color: black;">每一个</span>帧会标识出该帧属于哪个流,流<span style="color: black;">亦</span><span style="color: black;">便是</span>多个帧<span style="color: black;">构成</span>的数据流。多路复用,<span style="color: black;">便是</span>在一个 TCP 连接中<span style="color: black;">能够</span>存在多条流。这些改进<span style="color: black;">能够</span>避免 HTTP 队头阻塞问题,<span style="color: black;">加强</span>传输性能。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">头部压缩:</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">研发</span>人员<span style="color: black;">倘若</span>不<span style="color: black;">重视</span>对 header 内容的<span style="color: black;">掌控</span>,会<span style="color: black;">导致</span> header 内容<span style="color: black;">失去控制</span>的现象,客户端极容易存储一个非常大的 Cookie。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">HTTP2 的分帧传输机制:</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/45676600932e485280418bdbe39e3fe1~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=4WzKZIEhF%2BUM9yKXMWkidJhrFN0%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这个是非常有效的方式。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">尽可能离用户<span style="color: black;">近期</span>,利用边缘节点对路由、链路进行优化,<span style="color: black;">加强</span>动态服务的效率。相较于直连模式,<span style="color: black;">运用</span>动态加速后,P90 的接口延迟效率<span style="color: black;">提高</span>了 60%。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">爱奇艺海外动态加速的效果<span style="color: black;">提高</span>(请求时间为秒):</span></strong></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/48670e2ae02b40a6bf1ca0aba864dbe1~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=qitoSBhBall96DmekRTEKzPwVKs%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">针对</span>失败的请求,启用兜底的协议 QUIC <span style="color: black;">或</span> kcp。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">客户端的失败率在 3% <span style="color: black;">上下</span>,对这部分请求<span style="color: black;">运用</span> UDP 协议兜底尝试,在<span style="color: black;">咱们</span>的观察成功率<span style="color: black;">提高</span>了 45%。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">6、传输内容的优化</h1>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">6.1应用 Brotli</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">由于</span>预置了字典,在同等级别的压缩率下,对比 gzip <span style="color: black;">最少</span><span style="color: black;">提高</span>了 17% 的压缩比,接口平均的 Content-Size 由 30KB,降至 18KB。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">6.2接口由 JSON 改为 Google Protobuf</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">应用 Protobuf 的重要<span style="color: black;">原由</span>是解析效率比 JSON <span style="color: black;">最少</span>高四五倍,在节点深度和数据量大的<span style="color: black;">状况</span>下更<span style="color: black;">显著</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">但<span style="color: black;">重视</span> Protobuf 内部的 varint 压缩,只对<span style="color: black;">少于</span> 128 的数字进行可变长压缩。<span style="color: black;">实质</span>效果不大,生产环境<span style="color: black;">倘若</span>数据量大,外层的压缩如 gzip 不可少。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">PS:</span></strong><span style="color: black;">关于Protobuf的资料,<span style="color: black;">能够</span>进一步阅读《IM通讯协议专题学习》。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">6.3<span style="color: black;">照片</span>格式升级为 WebP</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在应用 WebP 的<span style="color: black;">同期</span>,降低海报<span style="color: black;">照片</span>的质量,实践看海报的 quality 设置为 85% 肉眼难以分辨,相对同质量的 JPEG <span style="color: black;">或</span> PNG ,<span style="color: black;">能够</span>最大减小 45% 的体积。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">应用效果<span style="color: black;">显著</span>。App 打开首页<span style="color: black;">照片</span>的加载<span style="color: black;">提高</span>肉眼可见。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">7、业务层面的优化改进</h1>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">7.1减少不必要请求:</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">有些</span>通用内容,如导航、频道,<span style="color: black;">一般</span>由运营人员主动更新。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">如下图:</span></strong><span style="color: black;"><span style="color: black;">增多</span>一个<span style="color: black;">起步</span><span style="color: black;">周期</span>请求的接口,里面放入内容更新的时间戳,与本地 cache 的时间戳有差异,则异步请求更新。</span></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/856712b91ab444208a46b1f30e4283f5~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725627022&x-signature=Wx2dtvi7OhIWsSQitlMkFcVSeRw%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">7.2区别用户网络,适应<span style="color: black;">区别</span>的策略</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">详细</span>作法是:</span></strong></p><strong style="color: blue;"><span style="color: black;">1)</span></strong><span style="color: black;"><span style="color: black;">针对</span>视频,非 WiFi 默认启播码率为 360P;</span><strong style="color: blue;"><span style="color: black;">2)</span></strong><span style="color: black;"><span style="color: black;">针对</span>海报,后端接口<span style="color: black;">供给</span>两种质量的 Url,WiFi 高质,4G 低质。</span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">7.3<span style="color: black;">更加多</span>的业务优化</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">增多</span>请求重试、<span style="color: black;">调节</span> HTTP 的超时时间,请求缓存等等 这些<span style="color: black;">能够</span><span style="color: black;">按照</span>业务的<span style="color: black;">需要</span>进行<span style="color: black;">调节</span>。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">8、本文小结</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">爱奇艺海外版APP经过一系列细节优化,用户体验<span style="color: black;">连续</span><span style="color: black;">提升</span>。用户接口延迟、客户端失败率、视频播放成功率一系列的关键指标得到很大的改善。这<span style="color: black;">亦</span>助力爱奇艺在东南亚多个国家的应用市场排名升至 TOP 1。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">另一</span> App 优化、Server 延迟优化、<span style="color: black;">制品</span>体验的改进,这一系列<span style="color: black;">仅有</span>相辅相成才<span style="color: black;">能够</span>最大化<span style="color: black;">提高</span>用户体验。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">9、参考资料</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> TCP/IP详解 - 第17章·TCP:传输<span style="color: black;">掌控</span>协议</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 网络编程懒人入门(三):快速理解TCP协议一篇就够</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 新手入门一篇就够:从零<span style="color: black;">研发</span>移动端IM</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 现代移动端网络短连接的优化手段总结:请求速度、弱网适应、安全<span style="color: black;">保证</span></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 全面<span style="color: black;">认识</span>移动端DNS域名劫持等杂症:技术原理、问题根源、<span style="color: black;">处理</span><span style="color: black;">方法</span>等</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 美图App的移动端DNS优化实践:HTTPS请求耗时减小近半</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 百度APP移动端网络深度优化实践分享(一):DNS优化篇</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 百度APP移动端网络深度优化实践分享(二):网络连接优化篇</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 百度APP移动端网络深度优化实践分享(三):移动端弱网优化篇</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 爱奇艺移动端网络优化实践分享:网络请求成功率优化篇</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 美团点评的移动端网络优化实践:大幅<span style="color: black;">提高</span>连接成功率、速度等</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 淘宝移动端统一网络库的架构演进和弱网优化技术实践</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 谈谈移动端 IM <span style="color: black;">研发</span>中登录请求的优化</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 移动端IM<span style="color: black;">研发</span>需要面对的技术问题(含通信协议<span style="color: black;">选取</span>)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 简述移动端IM<span style="color: black;">研发</span>的<span style="color: black;">哪些</span>坑:架构设计、通信协议和客户端</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> <span style="color: black;">微X</span>对网络影响的技术<span style="color: black;">实验</span>及分析(论文全文)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 腾讯原创分享(二):<span style="color: black;">怎样</span>大幅压缩移动网络下APP的流量消耗(上篇)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> IM开发者的零<span style="color: black;">基本</span>通信技术入门(十二):上网卡顿?网络掉线?一文即懂!</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> <span style="color: black;">微X</span>新一代通信安全<span style="color: black;">处理</span><span style="color: black;">方法</span>:基于TLS1.3的MMTLS详解</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> IM通讯协议专题学习(一):Protobuf从入门到精通,一篇就够!</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">技术交流:</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">- 移动端IM<span style="color: black;">研发</span>入门<span style="color: black;">文案</span>:《新手入门一篇就够:从零<span style="color: black;">研发</span>移动端IM》</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">- 开源IM框架源码:</p>https://github.com/JackJiang2011/MobileIMSDK(备用<span style="color: black;">位置</span>点此)
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(本文已同步发布于:</p>http://www.52im.net/thread-4669-1-1.html)
外贸网站建设方法 http://www.fok120.com/
页:
[1]