PreConnect: Site Booster Module
The Ocean Site Booster's PreConnect module allows you to speed up the loading of third-party assets by instructing visitors' browsers to establish early connections to external domains.
Before your site even requests a script, font, or image from an external server, PreConnect sets up the connection setup steps (DNS lookup, TCP handshake, and TLS negotiation) in the background. This cuts out valuable milliseconds of waiting time later.
The PreConnect feature is available as of Site Booster 1.5.0 version.
To enable PreConnect features, toggle to enable the module.
Enable (or disable) any option you would like to use, then save changes at the bottom of the module page.
Available PreConnect options include:
- Auto-Detect External Domains,
- Manual Domains,
- Add DNS-Prefetch Fallback,
- Best Practices & General Recommendation.
Auto-Detect External Domains
The Auto-Detect External Domains option allows the plugin to automatically scan enqueued scripts and stylesheets to find third-party domains and add preconnect hints for them.
When active, you don't have to guess which external assets your plugins are loading. The system dynamically reads your asset queue and tells the browser to preconnect to standard external sources like Google Fonts or asset CDNs.
Manual Domains
The Manual Domains field allows you to manually add specific domains that you want the browser to connect to ahead of time.
This is ideal for domains that are loaded dynamically via inline JavaScript (which the auto-detector might not see), such as external analytics trackers, chat widgets, tag managers, or payment gateways.
Formatting Tip: Enter one domain per line in the text area.
Both bare hostnames (eg., fonts.googleapis.com ) or full URLs (eg., https://www.google-analytics.com ) are fully accepted.
Add DNS-Prefetch Fallback
The Add DNS-Prefetch Fallback option allows you to output <link rel="dns-prefetch"> alongside each preconnect hint.
While modern browsers fully support preconnect hints, some older browser versions do not. Activating this option adds a lightweight DNS-prefetch fallback rule, ensuring that older legacy browsers can at least perform the DNS lookup step early, maximizing compatibility across all user devices.
Best Practices & General Recommendation
To gain the maximum performance benefit out of the PreConnect module without overwhelming your visitors' network bandwidth, follow these structural guidelines:
1. Be Selective (The "Less is More" Rule)
- The Pitfall: It can be tempting to add every external domain you see to the Manual Domains list. However, if you try to preconnect to 15 or 20 domains simultaneously, the browser will choke its own network sockets trying to set up all those connections at once, which actually slows down your primary site rendering.
- Recommendation: Limit your manual preconnect hints to the top 3 to 5 critical external domains that are used on almost every page (eg., Google Fonts, Google Tag Manager, or your asset CDN).
2. How to Identify External Domains
- Using DevTools: If you aren't sure which domains your site relies on, open a page in an Incognito window, right-click, and select Inspect. Go to the Network tab, reload the page, and look at the "Domain" column.
- Target the Heavy Hitters: Look for external URLs that load critical layout files or scripts early in the list, and copy those hostnames directly into your Manual Domains configuration field.
3. Clear Your Page Cache After Configuring
- Outputting the Hints: Preconnect parameters work by inserting specialized
<link>tags directly into your webpage's header HTML. Because of this, any time you add or adjust domains in this module, remember to head over to your Page Cache Module and clear the cache so the updated header tags are immediately active for live visitors. If you're using any other caching option/plugin, the recommendation remains the same: clear full website/CDN cache after configuring.
Enjoy optimizing your website's performance with Site Booster.
Found an error in this doc or believe it needs improvement?
Send us a prepurchase ticket, include the URL of the page, and add suggestions and more details about how we can make things better for you.
That's it!
Boost your WordPress website on all levels with OceanWP and Ocean Site Booster.