Service Worker 的 PageSpeed 见解

发布于 2025-01-11 05:14:48 字数 264 浏览 3 评论 0原文

我们的 CMS 使用图像服务 CDN,需要在图像 URL 中添加一些参数,以便在支持时提供优化格式(webp、avif...)。 这些参数无法直接在 CMS 上添加,因此当我们检测到支持的图像格式时,我们使用 Service Worker 添加它们。

问题是 PageSpeed Insight 测试一直说图像不是“下一代”格式,并且 URL 缺少参数。

有没有什么方法可以强制测试在安装了服务工作人员的情况下重新加载?谷歌通常使用服务工作者来计算性能统计数据吗?

谢谢!

Our CMS is using an image service CDN that requires a few parameters added to the URL of an image to serve optimized formats(webp, avif...) when supported.
The parameters cannot be added directly on the CMS, so we are using a service worker to add them when we detect a supported image format.

The problem is that PageSpeed Insight test keeps saying that the images are not "next-gen" format and the URL is missing the parameters.

Is there any way to force the test to reload with the service worker installed? Is google using service workers in general to calculate performance stats?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文