Available Front-end Libraries in China and Zdir's Self-built Front-end Library

Publish: 2018-10-10 | Modify: 2018-10-10

xiaoz has been using the front-end libraries provided by BootCDN. However, a few days ago, he found that the website was opening very slowly. After analyzing it with F12, he found that it was because of BootCDN. Currently, all BootCDN addresses are being redirected to CloudFlare. He has collected some available front-end libraries in China and provided a method for building a front-end library using Zdir for everyone's reference.

Sina Front-end Library

Sina Front-end Library has been around for a long time and is currently considered stable. It supports CDN and HTTPS, but it has fewer front-end resources.

URL: https://lib.sinaapp.com/

css.loli.net

This front-end library is provided by a private individual. If you haven't heard of this front-end library, you may have heard of sm.ms image hosting, which is also provided by this individual. css.loli.net supports Google Fonts, Gravatar avatars, and more.

Building a Front-end Library with Zdir

With 360 closing down Google Font acceleration services and BootCDN being redirected, even the front-end library address of big companies like Baidu frequently changes (now Baidu's address cannot be opened for testing). Therefore, it is more reliable to build your own front-end library.

Zdir is a directory listing program developed by xiaoz. If you are not familiar with it, you can refer to this article for an introduction. Zdir was originally designed to build a front-end library, so some optimizations have been made in this area.

1. Installing Zdir

Zdir is developed using PHP and only requires PHP support.

2. Usage

Zdir will process image, CSS/JS links and automatically convert them into HTML tags.

<!-- For example, the original link is: -->
https://libs.xiaoz.top/jquery/2.2.4/jquery.min.js
<!-- The copied link is: -->
<script src='https://libs.xiaoz.top/jquery/2.2.4/jquery.min.js'></script>

3. CDN Acceleration

CDN is essential for building your own front-end library in order to consolidate commonly used front-end resources and improve the loading speed of static resources.

  • Upyun: Upyun currently has good support for HTTPS new features and joining the Upyun alliance provides a certain amount of free quota. You can register here.
  • VeryCloud: I have introduced VeryCloud in the article "VeryCloud CDN Supports HTTPS, 50GB Free Traffic". VeryCloud offers 50GB of free traffic per month and supports HTTPS.
  • Tencent Cloud: Tencent Cloud CDN offers 10GB of free traffic per month and supports HTTP/2. The pricing is also reasonable.
  • Baidu Cloud Acceleration: There is a free version, but the nodes are not very stable. I have used the first three, but not Baidu's. Internet users jokingly call it "Baidu Cloud Deceleration".

Conclusion

Using Zdir, you can easily manage front-end resources and have flexible control over whether to close them and which resources are needed.

Zdir Source Code: https://github.com/helloxz/zdir


Comments