1 private link
Predicting what our users will do next is difficult, and it certainly requires a lot of planning and testing. But, the performance benefits are definitely worth chasing.
Adding
rel=preconnect
to a<link>
informs the browser that your page intends to establish a connection to another domain, and that you'd like the process to start as soon as possible.
Using script injection in WebPageTest enables me to experiment, to explore the complexities of which origins to preconnect too and which ones to avoid, and evaluate the results before I get clients to start changing their code.
"There is a different hint [that fetches the DNS, negociate TLS and setup the connection], called preconnect. It works much in the same way as dns-prefetch but sets up the rest of the connection as well."