换源/GitHack
GitHack 镜像源
公益缓存节点,把 raw.githubusercontent.com 文件以正确 Content-Type 直出,适合浏览器直接打开脚本/样式。
可用镜像源(2)
| 源 | 地址 | 说明 |
|---|---|---|
| GitHack | https://raw.githack.com | 公益免费 |
| 官方 raw(对照) | https://raw.githubusercontent.com | 原始地址,Content-Type 为 text/plain |
换源方法
引用 GitHub raw 文件
把 raw.githubusercontent.com 换成 raw.githack.com,路径不变;会以正确 MIME 类型返回
https://raw.githack.com/<user>/<repo>/<ref>/<file>
# 例:https://raw.githack.com/user/repo/main/style.css适用场景
浏览器直接 <link>/<script> 引用 raw 文件时,避免 GitHub 的 text/plain 与 nosniff 限制
<link rel="stylesheet" href="https://raw.githack.com/user/repo/main/style.css">使用提示
- ·分支引用内容会变,生产环境锁定 tag 或 commit。
- ·注意单文件大小限制与缓存延迟(jsDelivr 单文件 ≤20MB、分支缓存约 12h、不支持 @latest)。
- ·准备备用线路(Fastly/Gcore 等),主域不稳时切换。
- ·浏览器直引 CDN 时留意 CORS 与 Content-Type,raw 文件用 GitHack 之类可修正 MIME。