大网数据广告活动
网站运营与故障问答

CloudFlare isn't working as CDN

· 52CE 我爱测

Perhaps I'm not getting it as should, but as far as I got it, CloudFlare should use local(geographically) servers, relative to the user, to deliver the content. But instead, I'm getting all the time US servers(I'm in Europe). How…

问题原文

原帖链接 · prizzaloo · CC BY-SA 3.0

Perhaps I'm not getting it as should, but as far as I got it, CloudFlare should use local(geographically) servers, relative to the user, to deliver the content. But instead, I'm getting all the time US servers(I'm in Europe).

How do I fix this?

已采纳解答

原帖链接 · L Martin · CC BY-SA 3.0

You're likely using a geolocation service to determine the location of the IP address. This may not accurately tell you where the server for that IP is located - Cloudflare owns large IP blocks. These blocks will be registered to them somewhere in the USA and perhaps the servers for these IPs are even located there.

However, if they move a B block in that range to Europe, it means a 1 digit difference in the IP changes the location completely. 104.16.0.0/12 for example is a huge range of IPs. That's over 1.4 mil IPs split into around 64k B blocks (excuse my napkin math).

The ISPs would be aware of an edge router's location but IP block registration databases wouldn't. Do a ping command and use response time and TTL to measure distance. TTL will tell you how many routers your ping has bounced through - even if response time doesn't waver much you'll be able to see that it's gone a greater distance. For further detail, a tracert command (Windows) will also reveal more about location by attempting to resolve and ping each individual router along the way. Done from different origin IPs, you'll also be able to see if your ISP is doing any redirecting for Cloudflare in order to shorten distance travelled.

Edit: Another answer has pointed out you can also use yourdomain.com/cdn-cgi/trace in order to get a debug output with the 'colo=' code indicating the location of the server being used. Example output:

fl=21g22
h=yourdomain.co.uk
ip=your.ip.address
ts=1497653403.144
visit_scheme=https
uag=Mozilla Compatible Agent
colo=LHR // Datacentre location
spdy=h2
http=h2
loc=GB

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-03-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。