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

Canonical: https://scaplet.com/glossary/preconnect

Glossary Glossary · Performance

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fpreconnect%20(%22preconnect%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fpreconnect%20(%22preconnect%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fpreconnect%20(%22preconnect%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fpreconnect%20(%22preconnect%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## 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

_01_At a glance

## What preconnect saves

Before a browser can fetch anything from a new origin it must resolve DNS, open a connection and, on [HTTPS](/glossary/https), negotiate encryption. web.dev says this can take up to three round trips. Preconnect lets the browser do that work while it is still parsing your HTML, so the first real request to that origin starts with a ready connection.

Hint

### `preconnect`

Work done early

DNS, TCP and, for HTTPS, TLS

Use for

The few third-party origins the page needs very soon

Hint

### `dns-prefetch`

Work done early

DNS lookup only, which web.dev says typically takes 20 to 120 ms

Use for

Less critical third-party origins, and as a fallback for browsers without preconnect

Hint

### No hint

Work done early

Nothing until the first request

Use for

Same-origin resources and origins you hit late

MDN is explicit that preconnect has no benefit for same-origin requests, because that connection is already open.

_02_At 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](/glossary/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](/glossary/structured-data). 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">
```

**Too many preconnects cost bandwidth**web.dev warns that unnecessary preconnects can delay other important resources, because each one spends bandwidth on [TLS certificate](/glossary/ssl-certificate) exchange. MDN says to keep the hint for only the most critical connections and use `dns-prefetch` for the rest.

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

_04_Your 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](/glossary/preload)

For the font side of this, see [font-display](/glossary/font-display) and the [web fonts blocking text](/seo-issues/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. 01 [Establish network connections early (web.dev)](https://web.dev/articles/preconnect-and-dns-prefetch) web.dev · checked 2026-11-01
2. 02 [rel=preconnect (MDN)](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preconnect) developer.mozilla.org · checked 2026-11-01
3. 03 [Best practices for fonts (web.dev)](https://web.dev/articles/font-best-practices) web.dev · checked 2026-11-01

Questions

## Asked a lot.

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

_01_ Does 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.

_02_ How 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.

## Keep learning

[All glossary](/glossary)

[Learn font-display Performance](/glossary/font-display) [Related CDN Performance](/glossary/cdn) [Read next preload Performance](/glossary/preload) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Pogo sticking](/glossary/pogo-sticking) [PPC](/glossary/ppc) [Private blog network (PBN)](/glossary/private-blog-network)

More in Performance
[Gzip compression](/glossary/gzip-compression) [HTTP caching](/glossary/http-caching) [HTTP/2](/glossary/http-2) [HTTP/3](/glossary/http-3) [Image compression](/glossary/image-compression) [Interaction to Next Paint (INP)](/glossary/interaction-to-next-paint) [Largest Contentful Paint](/glossary/largest-contentful-paint) [Lazy loading](/glossary/lazy-loading) [Lighthouse](/glossary/lighthouse) [Page experience](/glossary/page-experience) [Page speed](/glossary/page-speed) [PageSpeed Insights](/glossary/pagespeed-insights) [preconnect](/glossary/preconnect) [preload](/glossary/preload) [Progressive web app](/glossary/progressive-web-app) [Real user monitoring (RUM)](/glossary/real-user-monitoring) [Render-blocking](/glossary/render-blocking) [Responsive design](/glossary/responsive-design) [Responsive images](/glossary/responsive-images) [Service worker](/glossary/service-worker) [Speculation rules](/glossary/speculation-rules) [Speed Index](/glossary/speed-index) [SVG](/glossary/svg) [Synthetic monitoring](/glossary/synthetic-monitoring)

Terms on this page
[HTTPS](/glossary/https) [CORS](/glossary/cors) [Structured data](/glossary/structured-data) [SSL certificate](/glossary/ssl-certificate) [preload](/glossary/preload) [font-display](/glossary/font-display)

Free · 2 minutes

## Know the term. _Now check your site._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
