使用说明

  • 不需要登录和注册,以 github 为例加速仓库所有内容
  • 格式:固定地址 https://cdn.jsdelivr.net/gh/+github用户名/+github公开仓库名
  • 完整示例:https://cdn.jsdelivr.net/gh/jquery/static/README.md
    github仓库建好 加速的时候要等会。

配置参考

npm 加速

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# load any project hosted on npm
https://cdn.jsdelivr.net/npm/package@version/file

# load jQuery v3.2.1
https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js

# use a version range instead of a specific version
https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js
https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js


# omit the version completely to get the latest one
# you should NOT use this in production
https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js

# add ".min" to any JS/CSS file to get a minified version
# if one doesn't exist, we'll generate it for you
https://cdn.jsdelivr.net/npm/jquery@3.2.1/src/core.min.js

# omit the file path to get the default file
https://cdn.jsdelivr.net/npm/jquery@3.2

# add / at the end to get a directory listing
https://cdn.jsdelivr.net/npm/jquery/

github 加速

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# load any GitHub release, commit, or branch
# note: we recommend using npm for projects that support it
https://cdn.jsdelivr.net/gh/user/repo@version/file

# load jQuery v3.2.1
https://cdn.jsdelivr.net/gh/jquery/jquery@3.2.1/dist/jquery.min.js

# use a version range instead of a specific version
https://cdn.jsdelivr.net/gh/jquery/jquery@3.2/dist/jquery.min.js
https://cdn.jsdelivr.net/gh/jquery/jquery@3/dist/jquery.min.js

# omit the version completely to get the latest one
# you should NOT use this in production
https://cdn.jsdelivr.net/gh/jquery/jquery/dist/jquery.min.js
https://cdn.jsdelivr.net/gh/jquery/jquery@latest/dist/jquery.min.js

# add ".min" to any JS/CSS file to get a minified version
# if one doesn't exist, we'll generate it for you
https://cdn.jsdelivr.net/gh/jquery/jquery@3.2.1/src/core.min.js

# add / at the end to get a directory listing
https://cdn.jsdelivr.net/gh/jquery/jquery/

wordpress 加速

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# load any plugin from the WordPress.org plugins SVN repo
https://cdn.jsdelivr.net/wp/plugins/project/tags/version/file


# load an exact version
https://cdn.jsdelivr.net/wp/plugins/wp-slimstat/tags/4.6.5/wp-slimstat.js


# load the latest version
# you should NOT use this in production
https://cdn.jsdelivr.net/wp/plugins/wp-slimstat/trunk/wp-slimstat.js


# load any theme from the WordPress.org themes SVN repo
https://cdn.jsdelivr.net/wp/themes/project/version/file


# load an exact version
https://cdn.jsdelivr.net/wp/themes/twenty-eightteen/1.7/assets/js/html5.js


# add ".min" to any JS/CSS file to get a minified version
# if one doesn't exist, we'll generate it for you

作为图床使用

单个文件 20MB 限制程序包大小 50MB 限制

github+jsdelivr+picgo 搭建一个图床

  • 下载安装 picgohttps://github.com/Molunerfinn/PicGo/releases
  • 配置
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # 仓库名为 cangk
    # 分支名为 static 或者 static+tag 如:
    # 路径就是仓库的文件路径,填写格式为`空`或者 `img/` 或者 `video/`

    仓库名:
    分支名:
    设定 Token:
    指定存储路径:
    设定自定义域名:

Github生成链接:

清理缓存