问题描述
我们的开发页面在页面速度洞察方面给出了正确的分数.
We have our development page giving correct score on page speed insights.
https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fdev.techtitute.com
但是我们的生产页面总是返回扫描错误:
But our production page always returns scan error:
Lighthouse returned error: FAILED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Details: net::ERR_CONNECTION_FAILED)
https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fwww.techtitute.com
奇怪的是,web.dev(也在幕后使用 Lighthouse)为两个页面以及 gtmetrix、pingdom 和 Chrome 开发工具 Lighthouse 选项卡都给出了正确的分数.
The strange thing is that web.dev (which also uses Lighthouse under the hoods) is giving correct score for both pages, also gtmetrix, pingdom and Chrome dev tools Lighthouse tab.
两个页面具有完全相同的代码,都在 Windows Azure 应用服务上运行.唯一的区别是:
Both pages have the exact same code, both are running on windows Azure App Service.The only differences are:
在生产过程中,我们将分析、fb 像素、linkedin 和其他内容注入 Google 标签管理器脚本.此外,我们还有一个 azure 流量管理器,可根据用户的地理定位(欧洲或拉丁美洲)分配流量.
On production we are injecting Google Tag Manager scripts with analytics, fb pixel, linkedin and others.Also we have an azure traffic manager to distribute traffic based on geolocalization of the user (Europe or Latam).
您认为生产页面出现该错误可能是什么问题?
What would you think could be the problem of production page giving that error?
更新 09/07/2020
我们创建了一个流量管理器的并行环境,分布在地理上,指向 2 个应用服务,代码与生产相同,但具有另一个域:dev3.techtitute.com.现在页面速度在这个子域上给出了与生产域相同的错误.所以我们认为这与 azure 流量管理器配置有关.
We have created a parallel environment of traffic manager geographically distributed pointing to 2 app services with the same code as production, but with another domain: dev3.techtitute.com.Now page speed is giving the same error on this subdomain, as the production one. So we think it's related to azure traffic manager configuration.
推荐答案
最后,我们通过将 Azure 上的流量管理器从地理路由更改为性能路由来解决该问题.
Finally we have solved the issue by changing traffic manager on Azure from Geographic Routing to Performance Routing.
现在页面速度是正常的得分
Now page speed is giving normal scoring
这篇关于PageSpeed 给出 ERR_CONNECTION_FAILED 仅在生产中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!