Skip to content

Commit 6a742b6

Browse files
committed
Drop Calendly preconnect down to dns-prefetch
I was wrong in 650efab. It turns out that the reason Chrome isn’t reusing the TCP/TLS from the `preconnect` had nothing to do with CORS, but is down to the fact that requests made with `Sec-Fetch-Mode: navigate` (e.g. `iframe`s) are placed into a separate connection pool[1], meaning only their DNS can be reused. A `preconnect` is actually quite wasteful in this scenario, and using a humble `dns-prefetch` is the only way to get any real gains. 1. chromium.org/developers/design-documents/network-stack/preconnect
1 parent 0ce73cf commit 6a742b6

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

contact.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ Or book a free call:
1616
<noscript><a href="https://calendly.com/csswizardry/30min" class="btn btn--full">Book a Free Call</a></noscript>
1717

1818
<div class="calendly-inline-widget" data-url="https://calendly.com/csswizardry/30min?background_color=f9f9f9&text_color=333333&primary_color=f43059" style="min-width:320px;height:700px;margin-bottom:1.5rem;"></div>
19-
<script src="https://assets.calendly.com/assets/external/widget.js" async fetchpriority=high></script>
19+
<script src="https://assets.calendly.com/assets/external/widget.js" async fetchpriority="high"></script>
20+
21+
<!--
22+
- Warm up the DNS for the resulting Calendly embed.
23+
-
24+
- It looks like Chrome puts `navigate` requests into a different connection
25+
- pool, meaning the TCP/TLS phase from a `preconnect` cannot be reused. This
26+
- means that `dns-prefetch` is actually going to be overall faster than
27+
- a wasteful `preconnect`.
28+
-->
2029
<link rel="dns-prefetch" href="https://calendly.com">
2130

2231
- - -

performance-audits.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,14 @@ triage the extent of performance issues with your site.
140140
<noscript><a href="https://calendly.com/csswizardry/ten-minute-teardown" class="btn btn--full">Book your <i>Fix It Fast!</i></a></noscript>
141141

142142
<div class="calendly-inline-widget" data-url="https://calendly.com/csswizardry/fix-it-fast?background_color=f9f9f9&text_color=333333&primary_color=f43059" style="min-width:320px;height:700px;margin-bottom:1.5rem;"></div>
143-
<script src="https://assets.calendly.com/assets/external/widget.js" defer fetchpriority=high></script>
143+
<script src="https://assets.calendly.com/assets/external/widget.js" defer fetchpriority="high"></script>
144+
145+
<!--
146+
- Warm up the DNS for the resulting Calendly embed.
147+
-
148+
- It looks like Chrome puts `navigate` requests into a different connection
149+
- pool, meaning the TCP/TLS phase from a `preconnect` cannot be reused. This
150+
- means that `dns-prefetch` is actually going to be overall faster than
151+
- a wasteful `preconnect`.
152+
-->
144153
<link rel="dns-prefetch" href="https://calendly.com">

0 commit comments

Comments
 (0)