function

fetch.preconnect

function preconnect(
url: string | URL,
options?: { dns: boolean; http: boolean; https: boolean; tcp: boolean }
): void;

Resolve a URL's DNS and establish a TCP connection before a request is made, to speed up the eventual fetch.

Not part of the Fetch API specification.

@param url

The URL to preconnect to

@param options

Which stages of the connection to set up

Referenced types

class URL

The URL interface represents an object providing static methods used for creating object URLs.

MDN Reference