161206

DNS prefetching 相关

Chromium uses the "href" attribute of hyperlinks to find host names to prefetch. However, some of those hyperlinks may be redirects, for example if the site is trying to count how many times the link is clicked. In those situations, the "true" targeted domain is not necessarily discernible by examining the content of a web page, and so Chromium not able to prefetch the final targeted domain.

  • chrome 会利用当前页面所有的href 里的链接来做DNS prefetch

  • 深层次的重定向不会prefetch

两条反馈的信息: 超链接浏览器自己做prefetch,跳转的,静态资源这些常用的点,浏览器并不帮你做,还是得手动prefetch

iframe 的预加载优化

  • 如何在预加载js的时候不执行 (利用image)

  • 进一步提升预加载性能(在页面加载完成够三秒执行prefetch的逻辑)

  • 不做重复加载,定期重复加载(利用localstorage)

css inline

加载成功的回调里加一条cookie 来标记该css 已经加载

之后load的时候,使用cookie与文件进行比对,命中则去直接加载(由于缓存,加载极快),如果没有命中,则inline去加载

按需加载css

一次实战,在一个页面里,有多个主题,根据type来按需进行css inline的处理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值