Free auditStart free
GlossaryGlossary · Performance

preconnect

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.

3 min
read
3
sources
Nov 1, 2026
updated
Scaplet Editorial Team
author
In one line

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.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
DNS, TCP and, for HTTPS, TLS ahead of time
Does
No benefit, the connection is already open
Same-origin
Need `crossorigin` on the font-file origin
Fonts
Unused connections closed within 10 seconds
Idle limit
02At a glance

Anatomy of the tags

Part

crossorigin on the font-file origin

Why it matters
web.dev says that without it the browser only performs the DNS lookup for resources fetched in anonymous mode, such as fonts
Part

No crossorigin on the stylesheet origin

Why it matters
web.dev's font guidance uses a plain hint for the stylesheet origin and adds crossorigin only for the font-file origin, because font files must be fetched over CORS
Part

Separate dns-prefetch tag

Why it matters
web.dev says combining both values in one tag triggers a Safari bug that cancels the preconnect
Part

Link header equivalent

Why it matters
Link: <https://example.com/>; rel=preconnect works without parsing markup. web.dev notes Google Fonts uses this approach
Google Fonts: two origins, two hints
<!-- stylesheet origin: no crossorigin -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<!-- font file origin: fonts are fetched with CORS, so add crossorigin -->
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!-- fallback, kept in a separate tag -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
03How it works

Check it in 2 minutes

  1. 1

    List third-party origins

    Reload with the Network panel open and sort by Domain. Note which origins serve fonts, scripts or images needed for the first view.

  2. 2

    Inspect connection timing

    Click one request from such an origin and open Timing. The DNS lookup, Initial connection and SSL rows show what preconnect could have saved.

  3. 3

    Add one hint

    Add a preconnect for the single most critical origin, with crossorigin if it serves fonts.

  4. 4

    Confirm it was used

    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.

04Your call

Preconnect, preload or neither

If this fits

Preconnect when

  • A critical font, script or image comes from a third-party origin
  • The request starts soon after the HTML is parsed, so the connection will be used inside 10 seconds
  • You have one or two origins, not a dozen
Or

Skip it when

  • The resource is on your own origin
  • The third party loads late or only after interaction, where dns-prefetch is enough
  • You already know the exact file and need it earlier, which is a job for preload

For 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.

Sources · 3

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • web.dev
  • mozilla.org
  1. 01Establish network connections early (web.dev)web.dev · checked 2026-11-01
  2. 02rel=preconnect (MDN)developer.mozilla.org · checked 2026-11-01
  3. 03Best practices for fonts (web.dev)web.dev · checked 2026-11-01
Questions

Asked a lot.

2 questions people ask next, answered from the sources on this page.

01Does preconnect work across origins only?

Yes. MDN says it benefits future cross-origin requests and gives no benefit to same-origin requests, since that connection is already open.

02How long does a preconnected connection stay 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.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly