Took some time, but I made it simple.
Introduction#
The reason for doing this is mainly because most jsDelivr mirrors do not allow for accelerating images, and there are still a bunch of images in my early articles that have not been migrated from GitHub.
It is precisely because it allows for accelerating images that I use Cloudflare CDN to distribute resources, so that Vercel's 100 GB traffic is not quickly consumed and attacks are prevented at the same time.
I haven't seen many similar projects online, so I thought of making one.
Usage#
Endpoint: https://jsd.lihaoyu.cn
Just replace https://cdn.jsdelivr.net
with https://jsd.lihaoyu.cn
.
The file structure follows the original structure of jsDelivr. It is recommended to specify a version number in the production environment to prevent unnecessary trouble caused by caching.
Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Bulma!</title>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
+ <link rel="stylesheet" href="https://jsd.lihaoyu.cn/npm/[email protected]/css/bulma.min.css">
</head>
<body>
<section class="section">
<div class="container">
<h1 class="title">
Hello World
</h1>
<p class="subtitle">
My first website with <strong>Bulma</strong>!
</p>
<figure class="image is-128x128">
- <img class="is-rounded" src="https://cdn.jsdelivr.net/gh/Big-Cake-jpg/Image_For_My_Blog/20230404_124948000_iOS.jpg">
+ <img class="is-rounded" src="https://jsd.lihaoyu.cn/gh/Big-Cake-jpg/Image_For_My_Blog/20230404_124948000_iOS.jpg">
</figure>
</div>
</section>
</body>
</html>
Cache Refresh#
I don't have a solution for cache refresh here.
If you want to refresh, you can leave a comment in the comment section, and I will refresh it once a week.