简体   繁体   English

使用 Lighthouse 失败的 Google Page Speed Test 返回错误:FAILED_DOCUMENT_REQUEST

[英]Failed Google Page Speed Test with Lighthouse returned an error: FAILED_DOCUMENT_REQUEST

When I check ( https://www.readonlinenewspaper.com ) site speed using PageSpeed Insights.当我使用 PageSpeed Insights 检查( https://www.readonlinenewspaper.com )网站速度时。 I am not able to see and results and get an error message like below:我无法查看结果并收到如下错误消息:

Lighthouse returned an error: FAILED_DOCUMENT_REQUEST. Lighthouse 返回错误:FAILED_DOCUMENT_REQUEST。 Lighthouse was unable to reliably load the page you requested. Lighthouse 无法可靠地加载您请求的页面。 Make sure you are testing the correct URL and that the server is properly responding to all requests.确保您正在测试正确的 URL 并且服务器正确响应所有请求。 (Details: net::ERR_CONNECTION_FAILED) (详情:net::ERR_CONNECTION_FAILED)

It is probably caused by one of two things它可能是由两件事之一引起的

1. The site just takes too long to load. 1. 网站加载时间过长。

Your page takes well over 40 seconds to load (on a high speed desktop connection, albeit in the UK and I am guessing this is somewhere else due to the long delay on requests.) so Page Speed Insights thinks it is broken as the page never completes loading within its timeout period.您的页面需要 40 多秒才能加载(在高速桌面连接上,尽管在英国,我猜这是由于请求的长时间延迟而在其他地方。)因此 Page Speed Insights 认为它已损坏,因为页面从未在超时时间内完成加载。

Your country flags are the main cause of this, you should instead consider a CSS image sprite , or inline SVGs as the total of 438 requests on your page is so high you will never get good performance (generally only 8 requests can be made at once so that means you have over 50 round trips to your server for resources.)您的国家标志是造成这种情况的主要原因,您应该考虑使用CSS 图像精灵或内联 SVG,因为您页面上的 438 个请求总数如此之多,您将永远无法获得良好的性能(通常一次只能发出 8 个请求所以这意味着您有超过 50 次往返服务器的资源。)

If each set of eight resources takes 200ms to complete that is 10 seconds of latency (dead time waiting for a response) on its own, for me they were taking 800 to 1000 ms each!如果每组八个资源需要 200 毫秒才能完成,那就是 10 秒的延迟(等待响应的死时间),对我来说,每个资源需要 800 到 1000 毫秒!

This is particularly slow so perhaps there is something wrong with your hosting configuration or website setup?这特别慢,所以您的主机配置或网站设置可能有问题? (You aren't storing the flag URLs in the database and looking them up one at a time in a loop by any chance are you?). (您不会将标志 URL 存储在数据库中并在循环中一次查找一个,是吗?)。

2. Hotjar 2. 热罐

For some reason Page Speed Insights doesn't seem to play well with hotjar.出于某种原因,Page Speed Insights 似乎不能很好地与 hotjar 配合使用。

It is something to do with websockets but I never got to the bottom of it I just know that this is a problem I see often when people use hotjar and it is related to web sockets (maybe something to do with the wss:// protocol or their implementation).这与 websockets 有关,但我从未深入了解它我只知道这是我在人们使用 hotjar 时经常看到的一个问题,它与 web sockets 有关(可能与wss://协议有关或其实施)。

Try disabling hotjar and run the test and see if it works then (perhaps test on another page when investigating this as it is only the homepage that is unbearably slow to load because of the flags as per point one).尝试禁用 hotjar 并运行测试,然后查看它是否有效(可能在调查此问题时在另一个页面上测试,因为它只是由于第一点的标志而加载速度非常慢的主页)。

ps the resource online-newspapers-banner-02.jpg is not being loaded over HTTPS so fix that, nothing to do with your question I just noticed the site was showing as "not secure" and I think that is the cause. ps 资源online-newspapers-banner-02.jpg没有被加载到 HTTPS 所以修复它,与你的问题无关我只是注意到该网站显示为“不安全”,我认为这就是原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM