Live data from Hacker News

Self-host your fonts for better performance

wicki.io

41–50 of 417 posts

Re: Self-host your fonts for better performance

#41
post #14
post #2

LocalCDN (Firefox Extension) solves the performance issue on the client side, i assume: https://addons.mozilla.org/en-US/firefox/addon/localcdn-fork... https://codeberg.org/nobody/LocalCDN/src/branch/main/resourc... (and adds extra privacy as a bonus.)

There is this tried-and-true extension: https://addons.mozilla.org/en-US/firefox/addon/decentraleyes... LocalCDN seems to be a fork of it, why should we be using it when it has so few users?

Why?

The development of Decentraleyes seems to have slowed down considerably, and LocalCDN supports more CDNs / frameworks, and is also opensource.

Re: Self-host your fonts for better performance

#42
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…

The "cleaner" feel may well be to do with better font rendering for desktop fonts, because you'll be using something like TTF rather than WOFF. Web font files have to trade off file size for quality, which desktop fonts don't have to do.

That's not it. WOFF is just a container format for OpenType and TrueType fonts with better compression and some metadata.

WOFF has nothing to do with rendering. You can achieve the exact same rendering with a WOFF file as you can with TTF; the contents are the same.

Re: Self-host your fonts for better performance

#43
post #9
post #6

Earlier quoted context omitted.

I've read your comment 3 times, and I'm still not exactly sure what you are suggesting, or what the purported benefit is? (it's probably my poor interpretation, but I'd appreciate if you wouldn't mind expanding :)

He wrote that: save bandwith and data caps. He would lose performance but win more privacy.

I understand the purpose of caching well enough; what I didn't understand was the proposal was to delay returning data from the cache.

Re: Self-host your fonts for better performance

#44

The reason why Google Fonts is so popular and provided through countless of CMS, plugins and hosted site builders is because it's super easy to embed.

Also themes. I've downloaded/purchased about a dozen of HTML/CMS/static site themes for my own projects over the years, and modifying them to get rid of Google's Fonts is the very first thing I have to do. With various JS/CSS libraries, there's a chance that they'll be self-hosted. For fonts, they're always loaded from Google Fonts.

I then have to occasionally re-do that work when there's a significant update to the theme that I want to have. It's really annoying.

Re: Self-host your fonts for better performance

#45
post #4

A question: instead of redownloading the same resources again and again, can we achieve privacy by adding delay between requesting a resource and providing it? It could be the same amount of time it took downloading it the first time or some randomized value. It won't speed up pages, but at least will save from bandwidth and data caps.

This happens somewhat by ensuring that timing APIs in Javascript don't have very high accuracy. But these attacks have gotten more sophisticated over time, and any random noise can be filtered out.

I thought that the timing is for attacking the cpu cache, not the web one. A request might take 100ms so such inaccuracy will be regressing lots of functionality.

My idea is for such delays to be introduced transparently in the caching service of the browser, not the js engine.

Re: Self-host your fonts for better performance

#46
post #6

Earlier quoted context omitted.

I've read your comment 3 times, and I'm still not exactly sure what you are suggesting, or what the purported benefit is? (it's probably my poor interpretation, but I'd appreciate if you wouldn't mind expanding :)

Site A can't see the cached resources of site B, because it would show that the user has visited site B if the resource is provided too fast. However, if the resource is provided with some delay, then site A assumes that site B hasn't been visited. The current solution is to download the same thing twice. It is wasteful and I offer downloading it only once, but if site A asks for a resource for site B, the resource s…

Ah, right, I understand your point now. When sites determine if something is cached or not, are they doing it purely based on the time taken to load it?

Re: Self-host your fonts for better performance

#48
post #46

Earlier quoted context omitted.

Site A can't see the cached resources of site B, because it would show that the user has visited site B if the resource is provided too fast. However, if the resource is provided with some delay, then site A assumes that site B hasn't been visited. The current solution is to download the same thing twice. It is wasteful and I offer downloading it only once, but if site A asks for a resource for site B, the resource s…

Ah, right, I understand your point now. When sites determine if something is cached or not, are they doing it purely based on the time taken to load it?

Yes, as far as I've seen the issue explained. I'm not sure though so I'm asking if someone knows for a side-channel that would invalidate my solution.

Re: Self-host your fonts for better performance

#49
post #39
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…

How does one do this for chrome/firefox? Google search gives result for the opposite problem.

firefox

options -> language and appearance -> advanced -> uncheck 'Allow pages to choose their own fonts, instead of your selections above'

Post reply on HN