Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

host on jsDelivr? #139

Open
tomByrer opened this issue Feb 29, 2016 · 9 comments
Open

host on jsDelivr? #139

tomByrer opened this issue Feb 29, 2016 · 9 comments

Comments

@tomByrer
Copy link

I help at a OSS CDN, jsDelivr, & floated the idea to host more webfonts there. I don't have the time to collate fonts (can't just mirror Google Fonts ;) ), but still want to host fonts there. jsDelivr has 4x+ more POPs than Fastly. jsDelivr has a huge POP network in China, which is missing in Fastly (though Fastly has a POP in my home town of Denver).

Could always use jsDelivr as a mirror; don't need to drop Fastly.
Semi-blocker: WOFF2.

@alfredxing
Copy link
Owner

This is definitely something we can look into. A couple of questions though:

  • How do you envision the CSS part to work? I'm thinking we could maybe add a flag to switch between CDNs.
  • Why is WOFF2 a semi-blocker for this issue? While there are significant decreases in size, adding WOFF2 support would likely mean having both the WOFF and WOFF2 files in the repo, which would mean almost doubling the repository size...

Thanks!

@tomByrer
Copy link
Author

  • I don't think jsDelivr has browser detection support, so it would have to cascade best to worst versions.
  • Not too worried about a few extra MB, we also host JARs which can be larger than webfonts. Besides, if you're really worried about filesize, you could remove extraneous vector paths... I am more worried about bandwidth, both server-side & for clients' to help deliver the best experience. I think that as good net citizens, we should always reduce net traffic, so we can watch more cat videos! ;)

@tomByrer
Copy link
Author

Also note there are 2 holes in WOFF browser compatibility; IE8 & down (~1%), Android 4.3 & down (1.5%), & Opera Mini (4.7%). I'm not too worried; mobile shouldn't download mobile fonts (though could break layouts), & MicroSoft is aggressively upgrading IE8 users.

@alfredxing
Copy link
Owner

OK! I'll think about it. Another thing I'm considering is that the current WOFFs are generated by FontForge (from both TTFs and OTFs), which doesn't seem to handle WOFF2 at the moment. The one or two WOFF2 conversion tools I've looked at so far only do TTF to WOFF...

@tomByrer
Copy link
Author

Not sure how they do it; perhaps convert backwards to TTF first?
https://everythingfonts.com/woff-to-woff2
But I'd suggest Googles' converter if you can export TTF from FontForge. I think that's what they use on their own CDN.

edit:
https://github.com/odemiral/woff2sfnt-sfnt2woff
https://github.com/masotime/woff2otf

@tomByrer
Copy link
Author

I almost forgot this spline point reducer:
https://github.com/googlefonts/fontcrunch

@alfredxing
Copy link
Owner

Converting back to TTF seems like the only way, at least for now. Not ideal since I'd want to keep CFF outlines for at least some of the problematic fonts.

@Celti
Copy link

Celti commented Jun 12, 2016

One advantage to jsDelivr: subresource integrity. While I can always generate the hashes myself, jsDelivr demands versioned (or versionable, at least) URLs so that I know a failing hash means something is wrong and not just that there's a new file version.

@jimaek
Copy link

jimaek commented May 8, 2017

The new backend is live. It pulls files directly from npm and github https://github.com/jsdelivr/jsdelivr#usage

Example https://cdn.jsdelivr.net/npm/jquery@3.1.1
Example directory listing https://cdn.jsdelivr.net/npm/jquery@3.1.1/

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

No branches or pull requests

4 participants