Live data from Hacker News

Self-host your fonts for better performance

wicki.io

81–90 of 417 posts

Re: Self-host your fonts for better performance

#81

Earlier quoted context omitted.

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.

Well, TIL about it being a container. But do they really contain an identical amount of information for font rendering? I'm no font expert, but I do know that you can have more or less information in a font file that affects how it's rendered.

Yes, it's just an Open Type file. The usual omitted stuff is subsetting a bigger font to include only certain glyphs you need, usually you don't mutilate font by removing rendering data from glyphs.

Re: Self-host your fonts for better performance

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

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.

Re: Self-host your fonts for better performance

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

So true! So many sites use those icons/symbols in the nav etc so their sites end up broken without web fonts. Other than that, it feels so much better and faster blocking web fonts.

Re: Self-host your fonts for better performance

#86
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?

I seem to remember some consternation not long ago when Decentraleyes reducing the amount of caching they do because it could be used for fingerprinting...? Can't find any reference to this on Google though

Re: Self-host your fonts for better performance

#87
Caching was nice but nicer is not to have to download the fonts, not to mkdir public/fonts, not to copy the files to that dir, not to match the file location in the css file and to have a CDN included for sites which I didn't employ with a CDN.

Besides, one should load one or max two fonts, not more and I couldn't care less if that 150kb is cached or not.

Re: Self-host your fonts for better performance

#88
post #77

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

The funny thing is that many sites today will serve their static assets via CDN so the article is basically saying switch from one CDN to another.

Re: Self-host your fonts for better performance

#89
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?

I tried LocalCDN after seeing a recommendation for it here, but despite claiming to cache more libraries it was very clearly not catching as many requests as DecentralEyes, which I'm back using now

Re: Self-host your fonts for better performance

#90
When I was doing a conversion from image based game banners (said how many people were in the server and shit) to a javascript solution that used a single json for all servers (as we got to 9 servers, loading at page start and refreshing these every n seconds was getting wasteful), I ran into this issue.

I wanted to keep the look and feel of the php/gd monospace font (could never find which font this used), but the normal defaultly included fonts i could find didn't have the same stylizing. Inconsolata on google fonts was however pretty close.

Only issue, there would be this ugliness for a half second when the page loaded while the font loaded, monospace has bigger size letters on the same font size, and its worse on firefox, so the banners would often wrap text that was suppose to be contained to one line while this loading happened. I couldn't preload the font, because cross-origin and doing the thing that is suppose to fix that didn't work in chrome.

So I just self hosted it, we already have cloudflare in front. Killed most of the delay, the preload tag killed the rest.

https://tgstation13.org

Post reply on HN