Newshot

Speed Insights 现已可衡量软导航

AI summary

Speed Insights 现在可以衡量软导航,即无需整页刷新即可更新页面内容的客户端路由变化,因此除了整页加载,还能跟踪用户在应用内浏览时的性能。它会为软导航捕获 LCP、FCP、INP 和 CLS 并纳入 Real Experience Score,但由于没有新的文档请求,不会捕获 TTFB。软导航跟踪对所有使用 Speed Insights 的项目默认开启、无需操作,适用于 Next.js、SvelteKit 和 Nuxt 等现代 Web 框架的 Chromium 浏览器;在项目仪表盘中可用新的 Navigation Type 筛选查看 All、Hard 或 Soft 数据,软导航事件会计入 Speed Insights Plus 用量。

Translation(model translation, not the source's own text)

Speed Insights 现在可以测量软导航(soft navigations):即客户端路由切换,在不完全重新加载的情况下更新页面内容。这意味着你现在可以跟踪用户在应用中浏览时的性能,而不只是在整页加载时。

Speed Insights 会为软导航捕获 LCP、FCP、INP 和 CLS,并将这些测量数据纳入你的 Real Experience Score。由于没有新的文档请求,因此不会捕获 TTFB。

对于所有使用 Speed Insights 的项目,软导航跟踪默认启用,无需任何操作。它适用于 Next.js、SvelteKit 和 Nuxt 等现代 Web 框架,以及基于 Chromium 的浏览器。

在项目的 Speed Insights 仪表板中,使用新的 Navigation Type 筛选器查看全部(All)、硬导航(Hard)或软导航(Soft)数据。

按软导航筛选的 Real Experience Score。
按软导航筛选的 Real Experience Score。
按软导航筛选的 Real Experience Score。
按软导航筛选的 Real Experience Score。

软导航事件会计入 Speed Insights Plus 的用量。现有的 Plus 客户将收到一封邮件,其中详细说明这些事件何时开始计费。对于新启用 Plus 的项目,这些事件从一开始就会计费。

要禁用软导航跟踪,请在你的应用代码中将 softNavs 设置为 false 并重新部署。此选项需要 @vercel/speed-insights 2.1.0 或更高版本:


        <SpeedInsights softNavs={false} />// orinjectSpeedInsights({ softNavs: false });
      

在你的应用中禁用软导航跟踪。

在 Speed Insights 文档中了解更多。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by Vercel Blog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗