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

critical-images

它能做什么

这项技能检查访客最先看到的图片是否以高优先级加载。适合希望可见内容加载更快、改善 Core Web Vitals 评分的开发者。

适用场景

  • ✓当页面上最大的图片加载缓慢时。
  • ✓当位于顶部可见的主视觉图被标记为懒加载时。
  • ✓当页面的主图没有被预加载时。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请让我首页的主视觉图优先加载,因为它是访客最先看到的最大内容。”

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

工作原理

智能体会为首屏可见的主图添加高获取优先级,在页面 head 中预加载主视觉图,并去掉开头可见图片的懒加载设置。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Prioritize loading critical images

The Largest Contentful Paint (LCP) is often an image—prioritizing its load can improve LCP by 20-40%, directly impacting Core Web Vitals and SEO.

Quick Reference

  • Use fetchpriority='high' on LCP images
  • Preload hero images in document head
  • Remove loading='lazy' from above-the-fold images
  • Critical images directly impact LCP Core Web Vital

Check

Identify which images are critical for initial render and ensure they load with high priority.

Fix

Add fetchpriority='high' to critical images and use preload for hero images.

Explain

Explain how prioritizing critical images improves Largest Contentful Paint (LCP).

Code Review

Review image assets, markup, and delivery configuration related to Prioritize loading critical images. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/images/critical-images

常见问题

什么是 LCP?

最大内容绘制(Largest Contentful Paint),用于衡量页面上最大的可见元素何时出现的速度指标,它通常是一张图片。

首屏图片应该懒加载吗?

不应该。这项技能建议去掉它们的懒加载。

这能带来多大的帮助?

这项技能说明,优先加载 LCP 图片可以使 LCP 提升 20% 到 40%。

详情

作者的原始描述

Use when reviewing image assets, markup, and CDN or build transforms related to Prioritize loading critical images. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能