简介

使用错误的cdn会导致博客服务无法访问,访问速度过慢的问题。因为众所周知的原因jsdelivr无法使用了,但是替换cdn不知道替换成什么比较好。使用新版butterfly的用户可以切换成本地模式,但是如果是旧版butterfly用户的话或者新版想要提升速度就需要第三方的cdn了。

替换方式

更改博客配置文件themes/butterfly/_config.yml

新版butterfly
更改cdn的option配置项

微信截图_20230806231047

更改配置项

链接

我这里只列出我在用的cdn,我没有用到的cdn可以在评论中留言,有时间我会补充。

main

1
https://cdn.staticfile.org/hexo-theme-butterfly/4.9.0/js/main.min.js

utils

1
https://cdn.staticfile.org/hexo-theme-butterfly/4.9.0/js/utils.min.js

translate(在用)

1
https://cdn.staticfile.org/hexo-theme-butterfly/4.9.0/js/tw_cn.min.js

local_search

1
https://cdn.staticfile.org/hexo-theme-butterfly/4.9.0/js/search/local-search.min.js

jquery

1
https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js

pjax

1
2
https://lib.baomitu.com/pjax/0.2.8/pjax.min.js
https://npm.elemecdn.com/pjax@0.2.8/pjax.min.js

sharejs(在用)

1
2
https://lib.baomitu.com/social-share.js/1.0.16/js/social-share.min.js
https://lib.baomitu.com/social-share.js/1.0.16/css/share.min.css

gittalk

1
2
gitalk: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/gitalk/1.7.2/gitalk.min.js
gitalk_css: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/gitalk/1.7.2/gitalk.min.css

valine

1
https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/valine/1.4.16/Valine.min.js

disqusjs

1
2
3
disqusjs: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/disqusjs/1.3.0/disqus.js

disqusjs_css: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/disqusjs/1.3.0/disqusjs.css

twikoo(在用)

1
https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/twikoo/1.4.18/twikoo.all.min.js

waline

1
https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/waline/1.5.4/Waline.min.js

algolia

1
2
3
algolia_js: https://cdn1.tianli0.top/npm/js-heo@1.0.11/algolia/algolia.js
algolia_search: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/instantsearch.js/2.10.5/instantsearch.min.js
algolia_search_css: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/instantsearch.js/2.10.5/instantsearch.min.css

lazyload

1
https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vanilla-lazyload/17.3.1/lazyload.iife.min.js

instantpage(在用)

1
https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/instant.page/5.1.0/instantpage.min.js

typed(在用)

1
https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/typed.js/2.0.12/typed.min.js

pangu

1
https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/pangu/4.0.7/pangu.min.js

fancybox

1
2
3
4
5
fancybox_css: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.css
fancybox: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.js

fancybox_css: https://cdn.staticfile.org/fancyapps-ui/5.0.19/fancybox/fancybox.min.css
fancybox: https://cdn.staticfile.org/fancyapps-ui/5.0.19/fancybox/fancybox.umd.min.js

medium_zoom

1
https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/medium-zoom/1.0.6/medium-zoom.min.js

snackbar(在用)

1
2
snackbar_css: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/node-snackbar/0.1.16/snackbar.min.css
snackbar: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/node-snackbar/0.1.16/snackbar.min.js

fontawesome

1
2
3
https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/6.0.0/css/all.min.css

https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.2.1/css/all.min.css

translate

1
https://cdn1.tianli0.top/npm/js-heo@1.0.6/translate/tw_cn.js

aplayer

1
2
aplayer_css: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.css
aplayer_js: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.js

justifiedGallery

1
2
justifiedGallery_js: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js
justifiedGallery_css: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/justifiedGallery/3.8.1/css/justifiedGallery.min.css

CDN选择原则
优先使用字节跳动的cdn,如果没有则使用elemecdn。