JQuery 的 CDN 离我的位置有多近?

How close is JQuery's CDN to my location?

我决定测试 JQuery 的 CDN 如何减少网站延迟,而不是只阅读理论。我的方法很基础。

假设网络开发人员在网页上放置了以下 JQuery (CDN) 标签:

<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>

code.jquery.com 的 DNS 查找应该 return 最近的(代理/缓存/CDN)服务器的 IP,具体取决于我在世界上的位置。

我有两个IP地址。

工作 我通过代理,我的 IP 映射到 美国。使用我的 phone 的 蜂窝连接 ,我的 IP 地址映射到 英国 (我位于英国)。我对此进行了多次测试。

使用这两个连接,我在 code.jquery.com 上执行了 DNS 查找。在这两种情况下,美国服务器的 IP 都是 returned:

code.jquery.com is an alias for code.jquery.netdna-cdn.com.
code.jquery.netdna-cdn.com has address 94.46.159.11

假设 DNS 查询会 return 欧洲的代理服务器(当我的 IP 映射到英国时)并且 jquery-1.12.0.min.js 由关闭边缘服务器。

更新

我发现这篇文章 Different CDN technologies: DNS Vs Anycast Routing 非常有用,我想把它放在这里供其他人使用。它涵盖了两种确保用户访问地理位置附近的边缘缓存服务器的方法。

我从我所在的位置(拉脱维亚)获得相同的 IP。但是我问了 jquery cdn 供应商(maxcdn.com)的人。他们告诉我这个:

Though the IP itself is registered in US, it's not a standard unicast IP. This one uses the anycast system, which means it resolves to multiple locations at the same time. The easiest way you can check that is to do a tracroute to 94.46.159.11 the traceroute will end up in Europe on one of our EU servers.

我已经追踪到请求,并最终到达了法兰克福。