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 has been around for a long time and is currently considered stable. It supports CDN and HTTPS, but it has fewer front-end resources.
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.
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.
Zdir is developed using PHP and only requires PHP support.
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>
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.
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
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.