一个域名,根据用户 ip 就近回源,用哪种方案比较好?

9次阅读

共计 216 个字符,预计需要花费 1 分钟才能阅读完成。

例如 美国用户访问时回源到 美国的源站。

伪代码表示我想实现的意图:

Browser:
    Access CDN domain (cdn.com)
CDN:
    if user IP is US:
        Serve from us.com origin
    else if user IP is Europe:
        Serve from eu.com origin
    else if user IP is China:
        Serve from cn.com origin
    else:
        Default action (not specified)
正文完
 0