Forum Moderators: martinibuster

Message Too Old, No Replies

Preconnect, DNS-Prefetch

More than 2 <link rel=preconnect> connections were found.

         

dolcevita

9:23 am on May 15, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



We had a discussion a year ago::
[webmasterworld.com...]

I'm wondering if anyone knows why the pagespeed lighthouse gives the warning:

Warnings:
A `<link rel=preconnect>` was found for "https://adservice.google.com" but was not used by the browser. Only use `preconnect` for important origins that the page will certainly request.
A `<link rel=preconnect>` was found for "https://www.googletagservices.com" but was not used by the browser. Only use `preconnect` for important origins that the page will certainly request.
A `<link rel=preconnect>` was found for "https://ajax.googleapis.com" but was not used by the browser. Only use `preconnect` for important origins that the page will certainly request.
More than 2 `<link rel=preconnect>` connections were found. These should be used sparingly and only to the most important origins.


Referring to:

More than 2 `<link rel=preconnect>` connections were found. These should be used sparingly and only to the most important origins.

I wonder if this means that there is a limit for use and that a maximum of 2 should be used? I don't see a warning for dns-prefetch, which means it only applies to preconnect. Does anyone know anything more about this?

rafraf

11:03 am on May 16, 2024 (gmt 0)

Top Contributors Of The Month



depends, test it with webpagetest, after my long researches I use preload for ads js's and use prefetch dns for important things instead of preconnect, web browser sees unsused preconnect as bad thing

I use preconnect only when i know it will be used, example ads, I have 5 preconnects and I can see in webpagetest waterfall that all are established by browser (chrome) so ignore warning but mind your resources