96 likes
路
6.2K reads
18 comments
Nice, but I麓d make an SVG if it is only for some letters.
That can work too!
David Ojeda, This is a great tip. Thanks for the write-up.
Thanks to you for the Bootcamp session, Tapas!
Wow! Awesome tip. Added to my TIL. 馃檶
Thanks! Glad you learned something with my post 馃檶馃徏
Lovely. I want to add that you can do the same thing with fonts you have bought somewhere else with a free tool like fontforge. I recommend this to everyone who has a high-traffic landing page. It鈥檚 pure money!
Thanks for the extra tip!
For popular fonts this will likely be slower and use more network access.
If they have already visited a site that uses the font you use by putting ?text= on the end you're forcing the browser to go off to Google to get your subset even though the full font file is sitting their in their browsers disk cache.
This is outdated wisdom, due to security issues:
chromestatus.com/feature/5730772021411840 bugzilla.mozilla.org/show_bug.cgi?id=1536058 bugs.webkit.org/show_bug.cgi?id=110269
Using the advice in the article is just fine.
NostraDavid Indeed, looks like they went ahead and chose sidechannel leaking privacy over perf. If you follow a lot of the discussions they claim there's little to no perf benefit from using caches.
I wonder how many of their tests and experiences were on fat company pipes and gigabit home internet connections... :(
Thanks to both of you for the discussion!
So, cache works or don't? 馃
David Ojeda From what I understand: Cache works, but if I go to example.com and load a woff font, I will have to redownload it for your site (doesn't matter if the URL is the same).
David Ojeda The cache is no longer shared between origins so there is literally no benefit to serving up from googlewebfonts, bootstrapcdn etc. any more.
If you have your own private CDN like Amazon CloudFront you may as well just copy the assets there now and be in full control.
NostraDavid Understood!
Damien Guard Got it. Good to know!
This is one of the best hack I read.
I was just picking out custom fonts for a project. I'll try this update next time I'm working on it.