原文章來自這位博主,灰常感謝他的分享,特此記錄一下。
無意間發(fā)現(xiàn)訪問蘋果開發(fā)者網(wǎng)站很慢很慢,查看一下不是網(wǎng)絡(luò)原因。
打開終端 首先 ping 一下這個域名輸入如下
ping developer.apple.com
終端內(nèi)容如下
Mac$ ping developer.apple.com
PING developer.apple.com (17.253.69.209): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from xx.xxx.xx.xxx: icmp_seq=1 ttl=47 time=82.071 ms
64 bytes from xx.xxx.xx.xxx: icmp_seq=2 ttl=47 time=90.751 ms
64 bytes from xx.xxx.xx.xxx: icmp_seq=3 ttl=47 time=85.870 ms
64 bytes from xx.xxx.xx.xxx: icmp_seq=4 ttl=47 time=81.579 ms
Request timeout for icmp_seq 5
在這個ip網(wǎng)站上面查詢了一下17.253.69.209這個ip的地理位置,發(fā)現(xiàn)這個ip居然在日本
* 本站數(shù)據(jù):日本 東京 蘋果公司
* 參考數(shù)據(jù)1:日本東京都東京
* 參考數(shù)據(jù)2:美國
* 兼容IPv6地址:::11FD:45D1
* 映射IPv6地址:::FFFF:11FD:45D1
所以如果找到一個中國相關(guān)的CDN節(jié)點(diǎn),速度應(yīng)該會快些。可以通過這個網(wǎng)站查詢節(jié)點(diǎn)
解決辦法:
快捷鍵 command + shift +G
輸入前往文件夾 /etc/hosts
復(fù)制hosts文件到桌面,在最后添加下面兩行內(nèi)容
17.253.85.202 developer.apple.com
17.253.85.201 devstreaming-cdn.apple.com
把桌面文件編輯好之后替換掉原來的即可。
(ps:添加第二行17.253.85.201 devstreaming-cdn.apple.com的原因是:在開發(fā)者網(wǎng)站中的視頻等靜態(tài)資源DNS到這個IP后能加速觀看和下載視頻以及下載其他資源的速度。)