performance-resource-hints
它能做什么
这个技能检查页面,并为关键资源和外部服务添加合适的资源提示。它面向希望关键内容更快出现的网站构建者。
适用场景
- ✓你请智能体加快页面上字体、首图或第三方服务加载速度的时候。
- ✓页面要等待 CDN 或分析等外部服务,才能显示内容的时候。
- ✓你想告诉浏览器下一页可能需要哪些资源的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/performance-resource-hints/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的页面要等很久才能加载字体和一个外部 API。请帮我添加合适的资源提示来加速吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会分析首屏最需要的资源,为关键文件添加 preload,为外部源添加 preconnect 或 dns-prefetch,并为可能访问的下一页添加 prefetch。然后它会建议在 DevTools 或 Lighthouse 中检查效果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Use resource hints for faster loading
Resource hints let the browser start fetching critical assets earlier—improving LCP by 100-300ms on average.
Quick Reference
- Use preload for critical above-the-fold resources (fonts, hero images)
- Use preconnect for third-party origins (CDNs, APIs, analytics)
- Use prefetch for resources likely needed on next navigation
- Use dns-prefetch as a lightweight alternative to preconnect
Check
Analyze resource hints on this page and verify critical resources use preload/preconnect for optimal loading.
Fix
Add appropriate resource hints (preload, prefetch, preconnect) for critical assets to improve loading performance.
Explain
Explain the differences between preload, prefetch, preconnect, and dns-prefetch and when to use each.
Code Review
Review the routes, assets, and loading behavior that affect Use resource hints for faster loading. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/performance/performance-resource-hints
常见问题
preload 和 prefetch 有什么区别?
这个技能说,preload 用于当前页面的关键资源,而 prefetch 用于下一次导航很可能需要的资源。
什么时候应该使用 preconnect?
这个技能推荐用于 CDN、API 和分析等第三方源。
页面会快多少?
这个技能说,这些提示平均可以把 LCP 提升几百毫秒,但实际效果取决于具体页面。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Use resource hints for faster loading. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #2976
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。