资讯动态

Core Web Vitals Audit

发布时间:2026/10/26 1:14:40 来源:尧图企业网站定制
【免费下载链接】claude-seoUniversal SEO skill for Claude Code. 26 sub-skills 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.项目地址https://gitcode.com/GitHub_Trending/cl/claude-seo点击查看免费下载URL/Origin:{target}Strategy:{strategy}CrUX Field Data (28-day rolling average)Real Chrome user experience data from the Chrome UX Report.Metricp75 ValueRatingGood ThresholdDistributionLCP{lcp_value}{lcp_rating}≤ 2,500msGood: {lcp_good}% / NI: {lcp_ni}% / Poor: {lcp_poor}%INP{inp_value}{inp_rating}≤ 200msGood: {inp_good}% / NI: {inp_ni}% / Poor: {inp_poor}%CLS{cls_value}{cls_rating}≤ 0.1Good: {cls_good}% / NI: {cls_ni}% / Poor: {cls_poor}%FCP{fcp_value}{fcp_rating}≤ 1,800msGood: {fcp_good}% / NI: {fcp_ni}% / Poor: {fcp_poor}%TTFB{ttfb_value}{ttfb_rating}≤ 800msGood: {ttfb_good}% / NI: {ttfb_ni}% / Poor: {ttfb_poor}%Collection Period:{collection_start} to {collection_end}Lighthouse Lab ScoresCategoryScorePerformance{perf_score}/100Accessibility{a11y_score}/100Best Practices{bp_score}/100SEO{seo_score}/100CrUX History Trends (25-week)MetricDirectionChangeEarliest → Latest{trends_table}Top OpportunitiesOpportunityEstimated Savings{opportunities_table}Recommendations{recommendations}CrUX data updated daily ~04:00 UTC. 28-day rolling average.INP replaced FID as the responsiveness Core Web Vital on March 12, 2024.Generated {timestamp}.### 2.1 头部信息{target} 与 {strategy} - {target}被审计的 URL 或 Origin。对应 [pagespeed_check.py](https://pre-link.gitcode.com/i/02e1adf687a1550fe8876f61613a191a) 中 query_crux() 的解析逻辑——若路径为空或 / 且无 query则判定为 origin 并以 origin 字段发送请求否则以 url 字段发送。 - {strategy}取值为 mobile、desktop 或 both。[pagespeed_check.py](https://pre-link.gitcode.com/i/eeec753ef4f92280c4551c2d64a817d7) 中 --strategy 参数默认 both会分别对两种策略各跑一次 PSI 并输出两组 Lighthouse 分数。由于 Google 自 2024 年 7 月 5 日起 100% 采用移动优先索引见 [cwv-thresholds.md](https://pre-link.gitcode.com/i/7540c0ac9d2935938a9ebc8acf02fd19)报告中通常以 mobile 结果为主要判定依据。 ### 2.2 CrUX Field Data 表五项指标的三元字段 这是模板的核心数据表五行分别对应 LCP、INP、CLS、FCP、TTFB 五项指标每行包含 p75 Value、Rating、Good Threshold、Distribution 四个信息维度 | 指标 | p75 判定基准 | Good 阈值 | Needs Improvement | Poor | |------|------------|-----------|-------------------|------| | LCP | 75 分位值 | ≤ 2,500ms | 2,500–4,000ms | 4,000ms | | INP | 75 分位值 | ≤ 200ms | 200–500ms | 500ms | | CLS | 75 分位值 | ≤ 0.1 | 0.1–0.25 | 0.25 | | FCP | 75 分位值 | ≤ 1,800ms | 1,800–3,000ms | 3,000ms | | TTFB | 75 分位值 | ≤ 800ms | 800–1,800ms | 1,800ms | 这些阈值在 [pagespeed_check.py](https://pre-link.gitcode.com/i/68f0dfa87c166c06d77bab62cca72ce5) 中被硬编码为 CWV_THRESHOLDS 字典与 [pagespeed-crux-api.md](https://pre-link.gitcode.com/i/701481e9b6ea7c5fa982bff786b23dbb) 中的阈值表完全一致并同步维护于 [cwv-thresholds.md](https://pre-link.gitcode.com/i/7540c0ac9d2935938a9ebc8acf02fd19)标注更新日期 2026-02-07。注意 cwv-thresholds.md 特别警告**阈值自原始定义以来从未收紧**SEO 博客中关于阈值变严的说法应忽略。 模板的 Rating 一列对应 rate_metric() 函数的三个输出good / needs-improvement / poor[pagespeed_check.py](https://pre-link.gitcode.com/i/2dbc753013626791620f2bafd5073d58)判定规则即 value good → goodvalue poor → needs-improvement否则 poor。Distribution 列的 Good/NI/Poor 百分比来自 CrUX API 响应中每个指标的 histogram 三分桶密度Good 对应第一个 bin、NI 对应第二个、Poor 对应第三个在 [pagespeed_check.py](https://pre-link.gitcode.com/i/adf1e599f120eafee547d4a82621a108) 中乘以 100 保留一位小数生成。 ### 2.3 采集周期{collection_start} 与 {collection_end} 对应 CrUX API 响应中的 collectionPeriod.firstDate/lastDate。CrUX 数据是 28 天滚动平均值每天约 04:00 UTC 更新存在约 2 天延迟。[pagespeed_check.py](https://pre-link.gitcode.com/i/a87015d3c0064fe015bb5c2a4c4374b7) 将其格式化为 YYYY-MM-DD 形式。需注意 CrUX 返回 404 表示该 URL/origin 因 Chrome 流量不足而无资格获得数据这是无数据而非鉴权错误——[SKILL.md](https://pre-link.gitcode.com/i/9b9be125f019cf86408349c38b9e0b9e) 错误处理表明确要求此时报告insufficient Chrome traffic并建议以 PSI 实验室数据作为回退。 ### 2.4 Lighthouse Lab Scores 表 四行对应 Lighthouse 四个类别的 0–100 分Performance、Accessibility、Best Practices、SEO。[pagespeed_check.py](https://pre-link.gitcode.com/i/88fec839ed0c1f0e6fed169bc21967fa) 从 PSI 响应 lighthouseResult.categories 中读取各分类 score0–1 浮点数并 round(score * 100) 转为整数。模板占位符 {perf_score}、{a11y_score}、{bp_score}、{seo_score} 即对应四个类别键 performance、accessibility、best-practices、seo。 Lighthouse 是模拟环境的实验室工具其分数不代表真实用户感受[cwv-thresholds.md](https://pre-link.gitcode.com/i/7540c0ac9d2935938a9ebc8acf02fd19) 明确写道 Field data is what Google uses for ranking. Lab data is useful for debugging.报告必须同时呈现两种数据才能避免误读。 ### 2.5 CrUX History Trends25 周趋势表 {trends_table} 由 CrUX History API 的 25 个周采集周期数据填充每行包含 Metric | Direction | Change | Earliest → Latest。对应 [crux_history.py](https://pre-link.gitcode.com/i/83b9355a6fb0eb19c31af4746a19d875) 的 detect_trends()第 208–260 行 - **数据源**POST https://chromeuxreport.googleapis.com/v1/records:queryHistoryRecord返回 percentilesTimeseries.p75s每周一个 p75 值与 histogramTimeseries[].densities每周三分桶密度 - **趋势判定**取有效数据的前 4 周平均值与后 4 周平均值对比计算百分比变化 change_pct。|change_pct| 5% → stablechange_pct 0 → improvingCWV 指标值越低越好负变化即改善否则 degrading数据点少于 8 个时标记 insufficient_data - **NaN 处理**不合格周次的密度可能返回字符串 NaN、分位值返回 null[crux_history.py](https://pre-link.gitcode.com/i/83b9355a6fb0eb19c31af4746a19d875#L164-L188) 在数值运算前逐一检查剔除这是模板中 Earliest → Latest 一列正确计算的前提。 ### 2.6 Top Opportunities 与 Recommendations {opportunities_table} 来自 PSI 响应中所有 details.type opportunity 且 overallSavingsMs 0 的审计项按预估节省毫秒数降序排列[pagespeed_check.py](https://pre-link.gitcode.com/i/1bb61555e4944d0ca448aaf2c16861d6)例如 Eliminate render-blocking resources (save ~1,200ms)。{recommendations} 由 Agent 基于 opportunities、failed audits、diagnostics 与 CrUX 趋势综合撰写模板不限定其格式但 [SKILL.md](https://pre-link.gitcode.com/i/9b9be125f019cf86408349c38b9e0b9e) 输出规范要求报告末尾始终附带数据新鲜度说明。 ## 三、底层数据链路从命令行到模板填充 ### 3.1 三步数据采集工作流 [SKILL.md](https://pre-link.gitcode.com/i/9b9be125f019cf86408349c38b9e0b9e) 的 Reports 章节给出了标准的 cwv-audit 数据流水线 bash # 1. 采集数据合并 PSI Lighthouse CrUX 字段数据默认双策略 python3 scripts/pagespeed_check.py https://example.com --json data.json # 2. 补充 25 周历史趋势 python3 scripts/crux_history.py https://example.com --json data.json # 3. 生成 PDF/HTML 报告也可直接以 --data 指定合并后的 JSON python3 scripts/google_report.py --type cwv-audit --data data.json --domain example.com赞分享【免费下载链接】claude-seoUniversal SEO skill for Claude Code. 26 sub-skills 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.项目地址https://gitcode.com/GitHub_Trending/cl/claude-seo点击查看免费下载相关推荐Spectre.css与Web Vitals优化Core Web Vitals的样式策略Spectre.css与Web Vitals优化Core Web Vitals的样式策略 你是否曾因网站加载缓慢而失去访客根据Google研究53%的移动前端UI组件nextjs-subscription-payments Web Vitals优化提升Core Web Vitals分数nextjs subscription payments Web Vitals优化提升Core Web Vitals分数 引言为什么Web Vitals对S后端前端Llama CoderWeb Vitals优化提升Core Web Vitals分数Llama CoderWeb Vitals优化提升Core Web Vitals分数 为什么Core Web Vitals对Llama Coder至关重要AI 应用代码智能体上一篇探索梦之维度DreamCraft3D引领的3D创作革命下一篇从入门到精通gh_mirrors/tou/tour带你掌握Go语言错误处理最佳实践创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑