Live data from Hacker News

Self-host your fonts for better performance

wicki.io

141–150 of 417 posts

Re: Self-host your fonts for better performance

#141
post #118

Earlier quoted context omitted.

Font designers publish poor quality fonts to promote their products? That isn't supposed to work.

Maybe it does. It isn't poor quality per se, on the first contact those fonts look great. Only prolonged usage will reveal their flaws, and then only if you know what you are looking for. Most buyers won't be so sophisticated, so it can work. Actually, lots and lots of products are sold in such a superficial way.

I'm not surprised at all that it works, I just think something must be broken if it does.

Re: Self-host your fonts for better performance

#142
post #77

This article isn't advocating saying goodbye to Google Fonts. It advocates not delivering them via CDN, but self-hosting them.

Yes it is...? Google Fonts is the service, not the fonts themselves. Check the "About" and "License" tab of any font on Google Fonts, they're not created by Google.

Re: Self-host your fonts for better performance

#143
post #22

Funny thing is that this site itself uses fonts from Google Fonts

Yeah. That's the first thing I noticed. I was curious whether the OP either returned back to Google Fonts since posting this or never did it in the first place!?

Do you mean they’re hosted by google or self-hosted?

Re: Self-host your fonts for better performance

#145

Does this mean that all CDN hosting of libraries, etc. will now be semi pointless for optimization?

I suppose it's still possible that a CDN-hosted file is served faster than a file from your server. And you may need to pay for that traffic.

But, basically, yes.

Re: Self-host your fonts for better performance

#146

Maybe I'm being naïve, but why don't browsers ship with more popular fonts bundled to avoid problems like these? I have no issue with any of my browsers taking up fractionally more space for an extensive cache of the most popular web fonts when the payoff is better performance on so many sites. Of course, servers should still be capable of serving the fonts that the client requires to render the content correctly, bu…

I've always thought the same. I see the same web fonts being used time and time again. It just makes sense for browsers to have an intelligent "permanent cache" - not based on your specific history but a common set of frequently sourced fonts, libraries, etc.

This would be especially helpful now that shared caches are going away.

One other option is to actually install the font into your OS. Any correctly-coded website will try a local source first, which should help a lot for poor connections.

Re: Self-host your fonts for better performance

#147
post #5

I'm usually the first one to sneer in disbelief at super users who 'go nuclear' and disable the likes of javascript and images when browsing the web, but lately, I've been experimenting with having custom fonts disabled (that is, fonts I don't have locally), and it feels to me that page loads are much faster, and in some case more readable (pages feel 'cleaner'?). The only issues I've come across so far is when a sit…

Web fonts are a big one in terms of making various websites feel fast because, when implemented incorrectly, they massively slow down initial text paint. With that said, they're a fantastic feature but are also way overused. You don't need web fonts unless your website is either heavily type-centric, or has font-related dependencies (such as embedded content of some kind). Icon fonts are also a neat use of web fonts,…

On multiple projects I've used a tool [1] to closely match a built-in font to a web font in order to present content faster and avoid avoid FOUC (Flash of Unstyled Content/Text). In one case, I replaced webfonts entirely with native platform fonts, purely for speed.

With this approach you can be more practical with your goals. If the design cannot be compromised, you can still get to initial paint quickly and let the WOFF files load in as needed.

Edit: If anyone is looking for more information about this, the post [2] from this tool's author from 2016 does a good job of discussing the tradeoffs.

[1] https://github.com/notwaldorf/font-style-matcher

[2] https://meowni.ca/posts/web-fonts/

Re: Self-host your fonts for better performance

#148

Maybe I'm being naïve, but why don't browsers ship with more popular fonts bundled to avoid problems like these? I have no issue with any of my browsers taking up fractionally more space for an extensive cache of the most popular web fonts when the payoff is better performance on so many sites. Of course, servers should still be capable of serving the fonts that the client requires to render the content correctly, bu…

I'm not an expert but: - 1. Copyright (though many fonts are free, true) - 2. Everyone uses a different font (just like everyone uses a slightly different version jquery) so cache hit would be pretty small IMO. Do you really want a browser to be gigabytes large? Especially on mobile it's not viable Maybe if browsers standardized on shipping, say, 20 carefully chosen fonts (not necessarily the most popular ones, just…

I mean I’ve said it before but shipping like 20 (montserrat, raleway, open sans, etc) would cover most websites who use Google Fonts.

Re: Self-host your fonts for better performance

#149

Maybe I'm being naïve, but why don't browsers ship with more popular fonts bundled to avoid problems like these? I have no issue with any of my browsers taking up fractionally more space for an extensive cache of the most popular web fonts when the payoff is better performance on so many sites. Of course, servers should still be capable of serving the fonts that the client requires to render the content correctly, bu…

I'm not an expert but: - 1. Copyright (though many fonts are free, true) - 2. Everyone uses a different font (just like everyone uses a slightly different version jquery) so cache hit would be pretty small IMO. Do you really want a browser to be gigabytes large? Especially on mobile it's not viable Maybe if browsers standardized on shipping, say, 20 carefully chosen fonts (not necessarily the most popular ones, just…

> Maybe if browsers standardized on shipping, say, 20 carefully chosen fonts (not necessarily the most popular ones, just a good variety of different types of fonts), the smaller websites would follow and use them; but I think any major brand likes to distinguish themselves and have a custom unique font.

It may be not really carefully chosen, but didn't Microsoft have done this already? (Core fonts for the Web, https://web.archive.org/web/20020124085641/http://www.micros...). The reason they have discontinued this programme is that it actually costs them some money (as the fonts are not owned by Microsoft.)

Also, how would you cater to non-LGC (Latin, Greek, Cyrillic) users?

Re: Self-host your fonts for better performance

#150

It's infuriating to see so much web tech being discarded created during the 90s and 00s in good faith, just because the web was subverted into an app delivery platform (in this case, shared caches were obsoleted by timing attacks) and the arms race for ever more crap to counter the negative effects, insufficiently. The web may now be a platform to lock-in and enslave users; just isn't anymore a recommendable place fo…

“Enslave users”, really?

Yes enslave. It might come sooner as you think with developers so busy to take their trivial apps and dev workflows into "the cloud", where they soon find they're being monitored and otherwise taken advantage off by the likes of Atlassian and github, to at best result in their replacement by a much cheaper workforce or robots. As compared to traditional F/OSS or commercial software seeking to empower users, use workflows based on open formats and principles of site autonomy. For end users addicted to their smartphones, it's game over already.
Post reply on HN