Tencent / VasSonic

VasSonic is a lightweight and high-performance Hybrid framework developed by tencent VAS team, which is intended to speed up the first screen of websites working on Android and iOS platform.
Other
11.81k stars 1.61k forks source link

把android demo中的地址改为别的地址,加载速度没有变快 #243

Closed whytry-GAR closed 6 years ago

whytry-GAR commented 6 years ago

https://github.com/Tencent/VasSonic/issues/239 承接之前的问题哈(不知道为啥被关闭了)

@marlonlu 但是这边都是拦截demo url来进行试验的。没有由服务端结算返回数据块(内容是直接返回整个页面),这边也开了local server模式。应该会由客户端计算并执行局部刷新吧? 这边拦截后 ,无论是demo url 还是自己的 test url(返回的内容相同) 都是Cache-Control: max-age=0 image

但是测试的结果(上一个回复https://github.com/Tencent/VasSonic/issues/239 )对比很奇怪,能解答下疑问吗?

可以的话可否通过别的方式聊下?qq或者微信

leo-plus commented 6 years ago

我也很关注这个问题,希望可以在github上公开讨论,或者私聊后同步结论。

marlonlu commented 6 years ago

这里可以公开讨论下

使用LocalServer模式,是download了整个页面,然后开子线程算md5跟拆分模块,得到变化数据库,再传给前端做局部刷新 而服务器改造后的完整模式下,通过对比etag跟template-tag,直接返回变化数据块,终端再直接返回数据块给前端做局部刷新

whytry-GAR commented 6 years ago

是的,所以在local server 模式下,同时又是fiddler拦截返回的内容,没有服务端配合的,按说应该会每次down整个页面,然后才解析处理,但是明显速度区别很大,详情请看上个回答的实验#239,无法明白相同条件下两个URL的加载速度区别,也不了解为何调用vassnoic阙没有区别,请解答下原因,还有可以让vassnoic优势更明显的调用方式,谢谢

marlonlu commented 6 years ago

LocalServer模式下 两个对比实验请附带上log跟fiddler的抓包截图

whytry-GAR commented 6 years ago

LocalServer模式: 这边是在demo中用到的new SonicSessionConfig.Builder()后添加setSupportLocalServer(true) image

额外添加两条日志区分普通加载和snoic加载并看速度 image

fiddler 拦截返回的内容 返回的内容为 https://github.com/whytry-GAR/somedemo/blob/master/webtest.html

(在demo返回的html基础上加上diff-data2,红框部分) image

拦截 image image

拦截结果(除了请求返回的头部中的date,其他没有区别) image

image image

实验1: demo 中的url (http://mc.vip.qq.com/demo/indexv3)返回上述webtest .html文件 普通加载三次: image

snoic加载三次: 清除缓存后第一次: image image

第二次: image

第三次: image

whytry-GAR commented 6 years ago

实验2:拦截任意测试url 例如( http://test.com),返回上述webtest .html文件 第一次 image image

第二次 image

第三次 image

重复实验过程中有出现过使用snoic加载显示等待时间较长,日志说是timeout,但普通加载却正常的情况

在github上沟通比较低效,不能实时交流,请尽可能说明详细,或换种方式以实时交流

marlonlu commented 6 years ago

这里沟通比较耗时,麻烦加入QQ群联系Android管理员沟通

vasdeveloper commented 6 years ago

经过QQ沟通,这里结论如下: Sonic在二次打开时由于缓存+局部刷新特性,会抹平用户不同网络环境下速度差异,提高用户体验