HTML 示例:<img src="/hero.jpg" width="1200" height="600" fetchpriority="high" alt="hero">
<img src="/below-the-fold.jpg" width="1200" height="600" fetchpriority="low" alt="below">
预加载脚本:<link rel="preload" as="script" href="/app-critical.js" fetchpriority="high">
脚本内控制:const link = document.createElement('link')
link.rel = 'preload'
link.as = 'style'
link.href = '/app.css'
link.fetchPriority = 'high'
document.head.appendChild(link)

发表评论 取消回复