Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leon406/cdn.js
静态CDN资源失效自动切换
https://github.com/leon406/cdn.js
autoswitch cdn
Last synced: about 2 months ago
JSON representation
静态CDN资源失效自动切换
- Host: GitHub
- URL: https://github.com/leon406/cdn.js
- Owner: Leon406
- License: apache-2.0
- Created: 2023-01-05T07:31:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T02:30:39.000Z (8 months ago)
- Last Synced: 2024-05-07T03:31:30.520Z (8 months ago)
- Topics: autoswitch, cdn
- Language: HTML
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 静态CDN资源失效自动切换
## **:warning: 此库作为本地资源加载,不要用cdn加载**
## 使用方式
```javascript
...
<!-- You should specify the package, version,ile, and your local resource path -->
loadCdnResource("jquery", "3.6.3", "jquery.min.js", "local.js", 2000)
<!-- and also can custom total CDN check timeout for quick response -->
loadCdnResource("jquery", "3.6.3333", "jquery.min.js", "local.js", 2000)
...```
备选服务方式,有默认cdn, 仅在CDN服务宕机后重新加载
```javascript
...
!window.jQuery&&loadCdnResource("jquery", "3.6.3", "jquery.min.js", "local.js")
...```
## CDN
### 国内CDN
- [七牛云](https://www.staticfile.org/)
- [360 75CDN](https://cdn.baomitu.com/)
- [饿了吗](https://npm.elemecdn.com)
- [知乎](https://unpkg.zhimg.com)
- [CDNBee](https://www.beecdn.com/)
- [BootCDN](http://www.bootcdn.cn/)
- [loli](https://cdnjs.loli.net/)
- [字节](http://cdn.bytedance.com/)### 国外CDN
- [CDNJS](https://cdnjs.com/) :star:
- [jsDelivr](http://www.jsdelivr.com/)
- [unpkg](https://unpkg.com/)