---
title: CdnPreconnect
description: This check is aimed at signaling the redundant preconnect to Shopify's CDN
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/cdn-preconnect
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/cdn-preconnect.md
api_name: liquid
---

# Cdn​Preconnect

The preconnect resource hint is a useful way of making sure connections to external domains are ready as soon as possible. It can improve performance by enabling the browser to start downloading critical assets right after discovering them in the HTML.

Because every Shopify store makes use of `cdn.shopify.com`, the platform already includes the preconnect resource hint inside the `Link` header in the main document response. This makes the preconnect in the HTML redundant.

Because [CDN assets are served from the main store domain](https://changelog.shopify.com/posts/changes-to-asset-urls), it's even more unnecessary, as there might be no assets coming from `cdn.shopify.com` at all. In this case, the redundant preconnect can negatively impact performance.

***

## Examples

The following examples contain code snippets that either fail or pass this check.

### ✗ Fail

```liquid
<link href="https://cdn.shopify.com" rel="preconnect" />
<link href="https://cdn.shopify.com" rel="preconnect" crossorigin />
```

### ✓ Pass

```liquid
<link href="https://example.com/" rel="preconnect" />
<link href="https://example.com/" rel="preconnect" crossorigin />
```

***

## Options

The following example contains the default configuration for this check:

```yaml
CdnPreconnect:
enabled: true
severity: warning
```

| Parameter | Description |
| - | - |
| `enabled` | Whether the check is enabled. |
| `severity` | The [severity](https://shopify.dev/themes/tools/theme-check/configuration#check-severity) of the check. |

***

## Disabling this check

Disabling this check isn't recommended because preconnect to Shopify's CDN is in the best case redundant and in the worst case negatively impacts performance.

***

## Resources

* [Introduction to resource hints](https://performance.shopify.com/blogs/blog/introduction-to-resource-hints)

***
