Skip to content
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

功能使用八:解决stackoverflow.com网站下cdn.sstatic.net加载慢 #144

Open
jingjingxyk opened this issue Jan 28, 2023 · 0 comments

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Jan 28, 2023

起因:打开https://stackoverflow.com/tags/socat/hot?filter=all 又出现很慢的情况了,一查发现,cdn.sstatic.net 加载很慢

排查办法:

dig cdn.sstatic.net

dig sstatic.net

排查结果:cdn.sstatic.net 使用了CloudFlare的AnyCast 技术 (称作泛播或者任意播的技术)

通过实验验证: sstatic.net 能用,还挺快

自定义一条规则,使用 sstatic.net 替换 cdn.sstatic.net 解决静态资源加载慢的问题

规则如下:

{
  "action": {
    "redirect": {
      "transform": {
        "host": "sstatic.net",
        "scheme": "https"
      }
    },
    "type": "redirect"
  },
  "condition": {
    "requestDomains": [
      "cdn.sstatic.net"
    ],
    "resourceTypes": [
      "main_frame",
      "sub_frame",
      "stylesheet",
      "script",
      "image",
      "font",
      "object",
      "xmlhttprequest",
      "ping",
      "csp_report",
      "media",
      "websocket",
      "webtransport",
      "webbundle",
      "other"
    ],
    "urlFilter": "cdn.sstatic.net" 
  },
  "id": 20019,
  "priority": 2
}

这个问题以前有提过: #79

启发文档: https://blog.csdn.net/u013411478/article/details/21953239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant