preconnect
- Work done early
- DNS, TCP and, for HTTPS, TLS
- Use for
- The few third-party origins the page needs very soon
rel=preconnect starts the DNS, TCP and TLS handshake to another origin early. Syntax, the crossorigin rule, the 10-second limit and when dns-prefetch is enough.
rel=preconnect is a link hint that tells the browser to set up a connection to another origin early: DNS lookup, connection and, for HTTPS, TLS. It only helps cross-origin requests, should be limited to the most critical origins, and the browser closes a preconnected connection that goes unused for 10 seconds.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
preconnectdns-prefetchMDN is explicit that preconnect has no benefit for same-origin requests, because that connection is already open.
Reload with the Network panel open and sort by Domain. Note which origins serve fonts, scripts or images needed for the first view.
Click one request from such an origin and open Timing. The DNS lookup, Initial connection and SSL rows show what preconnect could have saved.
Add a preconnect for the single most critical origin, with crossorigin if it serves fonts.
Reload and check that those timing rows are now near zero for the first request. If the origin is not used within 10 seconds, the browser closes the connection and the hint was wasted.
dns-prefetch is enoughFor the font side of this, see font-display and the web fonts blocking text issue. The wider family of hints is on the resource hints page.
2 questions people ask next, answered from the sources on this page.
Yes. MDN says it benefits future cross-origin requests and gives no benefit to same-origin requests, since that connection is already open.
web.dev says the browser closes any preconnected connection that is unused within 10 seconds, so only hint origins the page will request soon.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.