当前位置:网站首页>cdn.jsdelivr.net不可用,该怎么办
cdn.jsdelivr.net不可用,该怎么办
2022-07-28 05:35:00 【程序员小谭】
大家好,我是小谭。
事情是这样的,之前我的个人网站testtalking出现加载缓慢,乃至无法访问的问题。

最近,我在公号上免费提供给大家的软件测试项目,打开主页后,也会一直转圈。

问题原因
这两个问题的原因一样:引用了cdn.jsdelivr.net的静态文件,而该网站已经崩了。

cdn.jsdelivr.net是一个免费(可白嫖)的 CDN 站点服务,国内外很多网站都在白嫖它。
内容分发网络(Content Delivery Network,CDN):通过将站点内容发布至遍布全球的海量加速节点,使其用户可就近获取所需内容,避免因网络拥堵、跨运营商、跨地域、跨境等因素带来的网络不稳定、访问延迟高等问题,有效提升下载速度、降低响应时间,提供流畅的用户体验。
解决方案
既然cdn.jsdelivr.net已崩,不能白嫖,我们就得手动解决问题:
1、在代码里全文检索cdn.jsdelivr.net相关的链接
2、在浏览器输入这些链接,然后保存在本地(也可以手撸一个简单的request脚本,批量下载)
3、将下载的静态文件放到自己的CDN服务上(也可以放在代码本地路径下面)
4、替换代码里面,所有链接的访问路径为第3步的路径
如果你的个人网站遇到了相似问题,可以照此办法处理。但在处理的时候,你可能会遇到无法访问cdn.jsdelivr.net的问题,我也帮你找到了解决办法——根据版本号,去其他CDN服务获取静态资源,比如cdn.bootcss.com/axios/0.19.2/axios.min.js
此外,各大云服务厂商都可以购买CDN服务,我更建议你自己搭建一套CDN服务,比如我,自己便手动搭建了一个用于个人网站的CDN服务。
毕竟,该花钱的地方就要舍得花钱~
当然,上述工作,我都给你做完了。
你只需要去重新下载code.zip文件即可。

边栏推荐
- 学生执勤问题
- Insert sort of sort
- 教程篇(7.0) 06. 零信任网络访问ZTNA * FortiClient EMS * Fortinet 网络安全专家 NSE 5
- Shell --- conditional statement practice
- Standard C language learning summary 9
- How low-end computers learn secrets in depth - using the mistgpu computing platform
- 232 (female) to 422 (male)
- Pytorch extracts the feature map of a certain layer
- Standard C language learning summary 7
- TOPK problem
猜你喜欢

Continous Gesture Recognition with hand-orented spatiotemporal feature

The "nuclear bomb level" log4j vulnerability is still widespread and has a continuing impact

Generate create table creation SQL statement according to excel

Branch and loop statements

删除链表中的节点——每日一题

一口气学完4种 Redis 集群方案,真是各有千秋

Image segmentation method

High performance memory queue -disruptor

浅谈深分页问题

GFS distributed file system
随机推荐
Not used for the longest time recently
Pytorch extracts the feature map of a certain layer
High performance memory queue -disruptor
“核弹级” Log4j 漏洞仍普遍存在,并造成持续影响
Shell -- first day homework
N天前的日期
Freemaker merges cells, uses if and else tags, and processes null and empty strings
nodejs操作MongoDB
How low-end computers learn secrets in depth - using the mistgpu computing platform
Deployment of elk log analysis system
WiFi one click connection configuration of raspberry pie
低端电脑如何深度学习秘籍-使用mistGPU计算平台
C语言详解系列——数组详解,一维数组、二维数组
高性能内存队列-Disruptor
Principle and configuration of redis master-slave replication
Database-Trivial
Gobang optimized version
高响应比优先
Standard C language learning summary 9
Install pycharm