PageSpeed ​​Insights сообщает мне о предварительном подключении сторонних источников, а затем сообщает, что они не используются браузером после предварительного подключения - PullRequest
0 голосов
/ 14 июля 2020

Я запустил PageSpeed ​​Insights, и он сказал мне это

Preconnect to required origins
Consider adding `preconnect` or `dns-prefetch` resource hints to establish early connections to important third-party origins. Learn more.
URL
Potential Savings
https://fls-na.amazon-adsystem.com
https://ir-ca.amazon-adsystem.com
https://fonts.googleapis.com
https://images-na.ssl-images-amazon.com
https://ws-na.assoc-amazon.com

Я использую Gatsby, поэтому я подключил их с помощью плагина gatsby-plugin-preconnect

{
  resolve: 'gatsby-plugin-preconnect',
  options: {
    domains: [
      "https://ir-ca.amazon-adsystem.com",
      "https://fls-na.amazon-adsystem.com",
      "https://images-na.ssl-images-amazon.com",
      "https://fonts.googleapis.com",
      "https://ws-na.assoc-amazon.com"
   ]
 }
}

Затем я запустил PageSpeed ​​Insights снова, и он говорит мне

Preconnect to required origins
Warnings:
A preconnect <link> was found for "https://fonts.googleapis.com" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.
A preconnect <link> was found for "https://ws-na.assoc-amazon.com" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.
A preconnect <link> was found for "https://images-na.ssl-images-amazon.com" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.
A preconnect <link> was found for "https://fls-na.amazon-adsystem.com" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.
A preconnect <link> was found for "https://ir-ca.amazon-adsystem.com" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.

Я получил гораздо худшую оценку производительности с их предварительно подключенными

...