Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

amazon web services - getting Preconnect to required origins error in Lighthouse

I just moved my static website to AWS S3 + Cloudfront & Route 43. Once I deployed my site I ran Lighthouse & Pagespeed Insights and I'm getting "Preconnect to required origins Error!". enter image description here Before I moved my site I was not getting this error, so I'm thinking it has something to do with my AWS configuration. Here is my preconnects in my index.html file.

<link rel="preconnect" href="//www.google-analytics.com" crossorigin>
<link rel="preconnect" href="//fonts.googleapis.com" crossorigin>
<link rel="dns-prefetch" href="//fonts.googleapis.com">

I'm not connecting to any other 3rd parties, only Analytics & Google font. Am I missing a preconnect to cloudfront? I searched for a couple days online and have not found anything yet, so I'm here.

question from:https://stackoverflow.com/questions/65924851/getting-preconnect-to-required-origins-error-in-lighthouse

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you make requests directly to your Cloudfront domain, then you will need to preconnect to it too.

I'm not positive but should your href tag values start with https?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...