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的处理