跳到正文
Skillpedia
网站与界面(前端)75k · #2996

resource-hints

它能做什么

这个技能检查页面,并为关键文件、外部服务和可能访问的下一页添加合适的资源提示。它面向希望关键内容更快加载的网站构建者。

适用场景

  • ✓你请智能体加快关键文件或外部服务加载速度的时候。
  • ✓首图或字体加载较晚,拖延了主要内容的时候。
  • ✓你希望浏览器提前准备访客可能打开的下一页的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/resource-hints/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/resource-hints/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的首图和字体加载较晚。请帮我添加资源提示,让它们更早开始加载吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会找出首屏所需的关键资源,并为这些文件添加 preload。它会为外部域名添加 preconnect 或 dns-prefetch,并为访客可能接着打开的页面添加 prefetch。

技术内容(原始 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/rules/performance/resource-hints

常见问题

什么时候适合使用 preload?

这个技能推荐用于首屏的关键资源,例如字体或首图。

什么是 dns-prefetch?

这个技能把它描述为 preconnect 的轻量替代方案,它只解析域名。

我应该检查结果吗?

应该。这个技能说,应先在 DevTools、Lighthouse 或现场数据中确认真正的瓶颈。

详情

作者的原始描述

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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2996
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能