Skip to main content
Checks for preconnect hints to critical third-party origins
Rule IDperf/preconnect
CategoryPerformance
ScopePer-page
Severityinfo
Weight4/10

Solution

Preconnect establishes early connections to important third-party origins, saving time on DNS lookup, TCP handshake, and TLS negotiation. Add <link rel='preconnect' href='https://example.com'> for CDNs and critical third-party services. Use crossorigin attribute for CORS resources like fonts. Limit preconnects to 2-4 most critical origins to avoid connection congestion.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["perf/preconnect"]

Disable all Performance rules

squirrel.toml
[rules]
disable = ["perf/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["perf/preconnect"]
disable = ["*"]