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

无法访问报错

在我的友情链接里对于4秒内完成加载和图片加载的站点给了流畅标签,期望大家都能够加快自己的博客访问速度来提升友链整体的访问体验。

流畅标签

如果你觉得我的静态站访问速度还算不错(特别是第一次访问),可以试试替换为下面的cdn。

替换方式

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

新版butterfly

更改cdn的option配置项

更改配置项

旧版butterfly

直接更换cdn链接即可

更改配置项

链接

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

jquery

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

pjax

1
https://npm.elemecdn.com/pjax/pjax.min.js

gittalk

1
2
gitalk: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/gitalk/1.7.2/gitalk.min.js
gitalk_css: https://lf26-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
disqusjs: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/disqusjs/1.3.0/disqus.js
disqusjs_css: https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/disqusjs/1.3.0/disqusjs.css

twikoo(这个是定制版)

1
https://npm.elemecdn.com/js-heo@1.0.3/twikoo/twikoo.all.min.js

twikoo(官方版)

1
https://lf26-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://npm.elemecdn.com/js-heo@1.0.11/algolia/algolia.js
algolia_search: https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/instantsearch.js/2.10.5/instantsearch.min.js
algolia_search_css: https://lf26-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

fancybox

1
2
fancybox_css: https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.css
fancybox: https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.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://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/node-snackbar/0.1.16/snackbar.min.js

fontawesome

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

translate

1
https://npm.elemecdn.com/js-heo@1.0.6/translate/tw_cn.js

aplayer

1
2
3
aplayer_css: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.css
aplayer_js: https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.js
meting_js: https://npm.elemecdn.com/js-heo@1.0.12/metingjs/Meting.min.js

Prism

1
2
3
prismjs_js: https://npm.elemecdn.com/prismjs@1.1.0/prism.js
prismjs_lineNumber_js: https://npm.elemecdn.com/prismjs/plugins/line-numbers/prism-line-numbers.min.js
prismjs_autoloader: https://npm.elemecdn.com/prismjs/plugins/autoloader/prism-autoloader.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。