You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PSI API(v5)在CRuX页面数据不足时复用源数据,如何可靠识别?

Why PSI API (v5) Falls Back to Origin CRuX Data & How to Detect It

Great question—this behavior trips up a lot of developers working with the PageSpeed Insights API. Let’s break it down clearly:

Why Does PSI Fill loadingExperience with Origin Data?

The team behind PSI designed this fallback behavior for three key reasons:

  • Avoid empty or unhelpful responses: PSI’s core goal is to deliver actionable performance insights. If it returned an empty loadingExperience when page-level CRuX data was missing, developers would either get no usable data or have to handle messy edge cases that break integrations. Origin data is the next-best thing, as pages on the same domain usually share infrastructure, resources, and performance patterns.
  • Maintain API consistency: Keeping the response structure predictable (even when data is limited) reduces the work developers need to do to parse and use the API. You don’t have to write extra code to handle missing fields—you always get a valid loadingExperience object.
  • Provide meaningful context: Even if it’s not page-specific, origin-level CRuX data still gives a reasonable baseline for how the page might perform in the real world. It’s better than nothing for debugging or setting performance goals.

How to Reliably Detect When Page-Level CRuX Data Is Missing?

While PSI doesn’t include an explicit "fallback used" flag in the response, there are two reliable ways to spot this scenario:

  • Compare sampleSize values across metrics: For each performance metric (like largest_contentful_paint or first_input_delay), check the sampleSize in both loadingExperience.metrics and originLoadingExperience.metrics. If the page has its own CRuX data, these numbers will differ (the page’s sample size will be smaller or unique). If they’re identical across all metrics, PSI almost certainly used origin data as a fallback.
  • Cross-reference id fields with metric data: The loadingExperience.id is a hash of the page’s full URL, while originLoadingExperience.id is a hash of the domain. If the page has unique CRuX data, the metric values (like distributions and percentiles) in loadingExperience will differ from the origin’s. If every metric matches exactly and the sampleSize values are the same, it’s a fallback.

Note: Full value comparison alone isn’t 100% foolproof (incredibly rare cases where a page’s data matches the origin’s exactly), but pairing it with sampleSize checks eliminates almost all false positives.

内容的提问来源于stack exchange,提问作者Aaron Peters

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 08:47:28