首页 > 解决方案 > 尽管使用加载事件加载了第三方脚本,但 PageSpeed 得分没有提高

问题描述

我想在不影响 PageSpeed 分数的情况下将第三方 iframe 集成到我的网站中。最初,它们是通过对服务器的初始调用来调用的。我将它们移动到加载 js 中的加载事件。但是 PageSpeed 分数仍然没有提高。我也尝试了异步和延迟,但似乎没有任何效果。该网站是在 WordPress 中创建的。

我浏览了谷歌,但大多数想法似乎都围绕着在加载完所有内容后使用 load 事件加载它。我已经试过了。我还能做些什么来减少 iframe 的负载?它们是两个小部件,都使用 Google Tag Manager 跟踪。因此,总共加载了 3 个 Google Analytics 脚本。这使服务器响应时间成倍增加。

站点 URL 是https://iifd.in

如果您通过 PageSpeed Insights 运行,尽管我稍后使用 js 中的 load 事件加载了繁重的脚本,但移动端的得分却受到了严重影响。

任何帮助表示赞赏,谢谢!

标签: javascriptpagespeedgoogle-pagespeedgoogle-pagespeed-insights-api

解决方案


I checked your site with google page speed insight, few errors can be fixed easily.

Specifically

1.Does not use passive listeners to improve scrolling performance.

2.Image elements do not have explicit width and height.


推荐阅读