Live data from Hacker News

Self-host your fonts for better performance

wicki.io

161–170 of 417 posts

Re: Self-host your fonts for better performance

#161
post #47

I'd also point out that Google CDNs don't work in China and make your websites broken for 1/5th of the world's population. (Not to mention your leaking your user's info to Google - which is a dick move..)

which is a dick move Perhaps blocking a big part of the internet is the real dick move?

Both can be dick moves.

Re: Self-host your fonts for better performance

#162

Earlier quoted context omitted.

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…

Yep Asian fonts in particular are _huge_. It's a complex topic.

Re: Self-host your fonts for better performance

#163
post #159

That's a really sad side effect of cache partitioning. By the way, does anyone know if browsers are at least merging/deduplicating cached resources locally again (e.g. by storing cached objects by content hash)? The same could theoretically apply to computationally intensive tasks like WASM pre-compilation (although care should be taken to record the compilation time and delay loading appropriately for cached loads f…

It's actually a really sad primary effect of privacy abuses by large tech companies, let's place the blame where it needs to lie.

Re: Self-host your fonts for better performance

#164

Earlier quoted context omitted.

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,…

I've sped up sites before by using inline svg rather than icon fonts - downloading an entire icon font for a few icons is inefficient when the actual SVG needed for those icons is < 1Kb and is waaay faster as inline SVG.

Remarkbox does this with the default profile avatar, just-in-time dynamically rendered and inlined SVGs.

I've considered storing each default SVG into the user table and then inlining in the HTML but decided to wait on that optimization since inlining dynamic SVGs itself was such a significant speed boost, especially on threads with hundreds of comments.

Without inlining, each profile image or SVG would be a separate request parallel HTTP request and often at least a couple requests would be slow.

https://www.remarkbox.com

Re: Self-host your fonts for better performance

#165
post #15

Mainly for performance reasons I've recently gone from using hosted/local Google Fonts to just calling the system ones (some variant of `-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue`).

Seems most css frameworks are defaulting to this now. The only problem is Ubuntu is a very ugly font that looks very different from the others.

At my previous job I was one of the only Linux users (using Ubuntu) and some designers were shocked how bad their designs looked on my computer due to the Ubuntu font. We removed Ubuntu from the list and just went with sans serif instead.

Re: Self-host your fonts for better performance

#166

Earlier quoted context omitted.

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

You might be right, but the next question is fashion. Will the same fonts be used still in 5 years, or (more likely) the new hotness will arrive? Should the browsers update the list each year? Then some fonts that were available will suddenly be not? Not so great. Web standards and browser features are generally built for the long term and backward compatibility. I mean, it's not impossible to find a solution, but it…

At least it is not a problem for Google, since it controls both the most popular browse and most popular web font distribution channels.

Re: Self-host your fonts for better performance

#167

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…

How has the web been subverted? By whom? And which notable, useful old tecnologies have been discarded?

The capabilities of the web have only been expanded.

You can still build websites in Django and Rails and myriad other "old-school" technologies. What are you missing? Perl and CGI?

To the point of this article, you can perfectly build a website with self-hosted fonts, or with default system fonts. Is this what "lock-in" and discarding good ole' tech looks to you?

It's tiring to see this bitterly pessimistic, conspiracy-laden rhetoric on HN. With the added bonus that as of late it's being radicalized ("subverted", "enslaved"), as some sibling commenters are pointing out. How ironic that the people accusing everyone else of being "enslaved" are themselves carried away by the trends of the time.

But more importantly, this rhetoric is profoundly demeaning.

To web developers and technologists, because it assumes that they are largely incompetent or malicious, and that the commenter and his clique of retro-futurists know much better and are morally more pure than all tech professionals nowadays.

To regular people at large, because it paints them as drones and slaves to greater powers, with no agency whatsoever, instead of analyzing why they may prefer Facebook over old-school forums, and empathizing with them and their problems.

But above all, it's demeaning to the authors of such comments themselves, because it paints them as dejected, bitter fanatics who have lost sight of the forest for the trees.

The web is still full of opportunity - artistic, technical, commercial and otherwise.

If you don't think so, maybe it's time you embrace a low-tech lifestyle and devote yourself to gardening? Everyone will be better off for it.

Re: Self-host your fonts for better performance

#168
post #80

Earlier quoted context omitted.

Won't this break the UI of most sites because they (ab)use web fonts to add icons? It's annoying to hit a page with a video player, and all the buttons are little boxes with numbers in them because the icon font didn't load...

for me personally, I've only noticed this problem once, but I can't remember which site that was (must be one I don't visit often), but obviously your browsing habits are different to mine. I don't see any disadvantages to giving it a try yourself for a while tho' - it's just a single checkbox setting.

I have tried it with uBlock (not Firefox's native setting), and it breaks a ton of mainstream sites.

Re: Self-host your fonts for better performance

#169
post #32

Earlier quoted context omitted.

If you want a really fast web experience, try disabling images and javascript too! (on rereading this I sounded sarcastic, but I really wasn’t trying to be)

I'm using uMatrix and by default all javascripts are blacklisted until I explicitly enable it for the site. The downside of this is that lots of websites are broken, payment sites are non-functional, but after a week of building the whitelist, the web is somehow usable again.

uMatrix hasn't been updated in a year and the repo has been archived: https://news.ycombinator.com/item?id=24532973

You'll probably have to let it go someday :(

Re: Self-host your fonts for better performance

#170

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?

"Lacking any meaningful choice" on more locked-down platforms like the smartphone OS-es is a better choice of words. But when you get down to it and if you are into a bit more dramatic language, "enslaved" (with proper context attached) isn't that far off, no?
Post reply on HN