From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/html/attributes%2Frel%2Fpreconnect.html | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 devdocs/html/attributes%2Frel%2Fpreconnect.html (limited to 'devdocs/html/attributes%2Frel%2Fpreconnect.html') diff --git a/devdocs/html/attributes%2Frel%2Fpreconnect.html b/devdocs/html/attributes%2Frel%2Fpreconnect.html new file mode 100644 index 00000000..2584c793 --- /dev/null +++ b/devdocs/html/attributes%2Frel%2Fpreconnect.html @@ -0,0 +1,68 @@ +

rel=preconnect

+

The preconnect keyword for the rel attribute of the <link> element is a hint to browsers that the user is likely to need resources from the target resource's origin, and therefore the browser can likely improve the user experience by preemptively initiating a connection to that origin. Preconnecting speeds up future loads from a given origin by preemptively performing part or all of the handshake (DNS+TCP for HTTP, and DNS+TCP+TLS for HTTPS origins).

<link rel="preconnect"> will provide a benefit to any future cross-origin HTTP request, navigation or subresource. It has no benefit on same-origin requests because the connection is already open.

If a page needs to make connections to many third-party domains, preconnecting them all can be counterproductive. The <link rel="preconnect"> hint is best used for only the most critical connections. For the others, just use <link rel="dns-prefetch"> to save time on the first step — the DNS lookup.

+
+

Examples

+
+
+

html

+
<link rel="preconnect" href="https://example.com" />
+
+

You can also implement preconnect as an HTTP Link header, for example:

+

http

+
Link: <https://example.com>; rel="preconnect"
+
+
+
+

Specifications

+
+ + +
Specification
HTML Standard
# link-type-preconnect
+

Browser compatibility

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
preconnect4679
39Before Firefox 41, it doesn't obey the crossorigin attribute.
No3311.14646
39Before Firefox 41, it doesn't obey the crossorigin attribute.
3311.34.0
+

See also

+
+

+ © 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preconnect +

+
-- cgit v1.2.3