Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDN #1

Open
antfu opened this issue Mar 6, 2020 · 4 comments
Open

CDN #1

antfu opened this issue Mar 6, 2020 · 4 comments

Comments

@antfu
Copy link
Member

antfu commented Mar 6, 2020

I create this repo for hosting files for CDNs. I am planning to use different branches for different projects.

jsDelivr has an awesome feature that direct host files from Github repos, and surprisingly it's kinda fast in China.

So I moved files that originally hosted by Netlify to this repo by a Github Action:

https://wy-lang.org/dist/core.js (somehow it's very slow in China)

now becomes:

https://cdn.jsdelivr.net/gh/wenyan-lang/cdn@wenyan-core/core.min.js (and with the .min.js suffix, jsDelivr will automatically minimize for you)

I also changed the CDN for IDE in wenyan-lang/ide@3f03542

So far it's just a quick experiment and I think it works well. In the future, you may consider moving fonts for wenyan-book by these steps to get better loading speed for users in China. :)

@LingDong-
Copy link
Member

Very cool! 👍

Is it purely out of pursuit of neatness that we move all wanted files to this repo instead of just using their own jsDelivr links? e.g.:

https://cdn.jsdelivr.net/gh/LingDong-/wenyan-book/assets/font.woff2

@antfu
Copy link
Member Author

antfu commented Mar 6, 2020

Yeah, I think the font subset is ok to be in the repo and use is directly by jsDelivr. (Please also aware that
jsDelivr only accept repo that smaller than 30MB)

The main reason this repo gets introduced is that files like those are CI/CD on every commit automatically. And for most of the time, you don't want to commit these files into source control and manually rebuild it repeatedly.

And yeah, maybe another way is to commit files into a different branch of the source repo instead this centralized repo.

@antfu
Copy link
Member Author

antfu commented Mar 13, 2020

FYI, I have moved the dist files to the cdn branch of the main repo. I think this repo becomes redundant, will delete it in some days (to keep the old link available for caches to update).

@LingDong-
Copy link
Member

👍 Sounds good. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants