The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 802 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.1 (Linux)
File Line Function
/showthread.php 802 errorHandler->error

Current time: 12-06-2019, 05:53 AM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP2 multi-origin connection sharing vs DNS requests
10-18-2018, 11:05 PM (This post was last modified: 10-19-2018 07:34 PM by jakub.)
Post: #1
HTTP2 multi-origin connection sharing vs DNS requests
I'm trying to understand the behavior observed in my tests.

We use an HTTP2-enabled CDN that is available under multiple domain names (that all resolve to the same IP at the end for a given user, normally -- unless the DNS requests happen at different time and the load balancing kicks in), for example:

The domains were created long time ago for sharding + differentiating http vs https calls, but essentially they are all equivalent nowadays.

I was thinking this would be an antipattern as it would cause a DNS+TCP+TLS for each of those domains, but actually it's not true. It seems that HTTP2 is intelligent enough to reuse the connection even across the domains if it's sure it's talking to the same server.

Test page:


As you can see, Chrome immediately reuses the existing h2 connection (no DNS, no TCP, no TLS).
Firefox does a DNS query first, and then reuses the existing h2 connection (no TCP, no TLS).

I can explain the behavior of Firefox:
- DNS request to both servers, notices the same IP
- TLS handshake returns a cert with `*,` subjectAltName

What is surprising to me though is that Chrome doesn't do DNS request to get IP of the second server. How does it know that `static1` and `static2-ssl` are the same thing then?
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
HTTP2 multi-origin connection sharing vs DNS requests - jakub - 10-18-2018 11:05 PM

Forum Jump:

User(s) browsing this thread: 2 Guest(s)