javascript - 尽管使用加载事件加载了第三方脚本,但 PageSpeed 得分没有提高
问题描述
我想在不影响 PageSpeed 分数的情况下将第三方 iframe 集成到我的网站中。最初,它们是通过对服务器的初始调用来调用的。我将它们移动到加载 js 中的加载事件。但是 PageSpeed 分数仍然没有提高。我也尝试了异步和延迟,但似乎没有任何效果。该网站是在 WordPress 中创建的。
我浏览了谷歌,但大多数想法似乎都围绕着在加载完所有内容后使用 load 事件加载它。我已经试过了。我还能做些什么来减少 iframe 的负载?它们是两个小部件,都使用 Google Tag Manager 跟踪。因此,总共加载了 3 个 Google Analytics 脚本。这使服务器响应时间成倍增加。
站点 URL 是https://iifd.in
如果您通过 PageSpeed Insights 运行,尽管我稍后使用 js 中的 load 事件加载了繁重的脚本,但移动端的得分却受到了严重影响。
任何帮助表示赞赏,谢谢!
解决方案
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.
推荐阅读
- python - 导入 pyside6 时出错,DLL 加载失败:找不到指定的程序
- java - 如何将一个月 DTO 分成两部分,就好像它是一个单独的月份一样?
- python - 使用 df.applymap(str) 时如何忽略 NAN 转为字符串
- .net - 未捕获的 Sys.InvalidOperationException:Sys.InvalidOperationException:“CaptionText”不是属性或现有字段
- arrays - 如何以数组的形式读取单行上的数字列表?
- spring-integration-sftp - Spring Integration Sftp - 如何初始化出站适配器以发送文件
- go - 当第二个结构使用字段子集时,将结构列表转换为另一个结构的列表
- opencv - OpenCV 4.5.3 中的 OpenCV cv::ORB::ScoreType 错误
- javascript - Promise的executor内部操作的含义是异步的
- scala - Akka HTTPS 如何支持 TLS1.2