-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloudflare 优化 #7
Comments
高延迟情况下, 用户侧优化
<link rel="dns-prefetch" href="hostname">
<link rel="subresource" href="/static/f.js">
<link rel="prefetch" href="/path">
<link rel="prerender" href="//host/path">
// 根据用户操作动态添加
// prefetch 不同浏览器中行为不一样, 建议加上 Cache-Control: public, max-age=60
var hint = document.createElement('link');
hint.setAttribute('rel', 'prerender');
hint.setAttribute('href', 'next-page.html');
document.getElementsByTagName('head')[0].appendChild(hint);
// prerender 生效因素比较多, 可以尝试public cache & prefetch
服务器端优化
链路及cdn缓存优化
chrome debug timeline 部分情况下会显示 local cache 加载缓慢(500ms以上), 一般是插件影响了, 可以关闭后重试 curl -w "TCP handshake: %{time_connect}, SSL handshake: %{time_appconnect}\n" -so /dev/null https://www.alipay.com |
国内各运营商连到的节点
源站建议选California |
|
cloudflare partner
|
// 寻找 cloudflare速度比较快的节点 echo "range = 173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/12,172.64.0.0/13,131.0.72.0/22 // 扫描ping值小于130节点 |
cf回源ip段信息, 用户请求到的节点(机房)直接回源, 不会优化到到源站链路,
电信推荐百度云合作ip
162.159.208.4-162.159.208.103
162.159.209.4-162.159.209.103
162.159.210.4-162.159.210.103
162.159.211.4-162.159.211.103
联通日本
141.101.113.59
目前国内连接状况
CloudFlare Partners 自定义
节点测速
工具: https://github.com/digineo/go-ping
windows & linux 可执行文件: pingtest.tar.gz
下载后, 终端或cmd下执行
The text was updated successfully, but these errors were encountered: