We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
优点:
<link rel="preload" href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff" as="font"> <link rel="prefetch" href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff" as="font">
对于font的加载,有两个级别:Highest和High。假如用两个方式加载同一font资源:
<link rel="preload" as="font" href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff">
结果是加载两次同一个font文件
原因是由于其来源的origin不同,浏览器判断不是同一缓存文件
解法:添加crossorigin。例如:<link rel="preload" as="font" crossorigin href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff">
<link rel="preload" as="font" crossorigin href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff">
用 preload 预加载页面资源 HTTP/2 PUSH(推送)与HTTP Preload(预加载)大比拼| Dexecure Preload,Prefetch 和它们在 Chrome 之中的优先级
The text was updated successfully, but these errors were encountered:
sihai00
No branches or pull requests
资源加载优先级Preload和Prefetch
优点:
1. 资源加载两次
1.1 preload 和 prefetch 混用
1.2 用 preload 加载不带crossorigin的跨域资源
对于font的加载,有两个级别:Highest和High。假如用两个方式加载同一font资源:
<link rel="preload" as="font" href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff">
结果是加载两次同一个font文件

原因是由于其来源的origin不同,浏览器判断不是同一缓存文件


解法:添加crossorigin。例如:
<link rel="preload" as="font" crossorigin href="https://at.alicdn.com/t/font_zck90zmlh7hf47vi.woff">
参考
用 preload 预加载页面资源
HTTP/2 PUSH(推送)与HTTP Preload(预加载)大比拼| Dexecure
Preload,Prefetch 和它们在 Chrome 之中的优先级
The text was updated successfully, but these errors were encountered: