Live data from Hacker News

Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

pixelambacht.nl

91–100 of 156 posts

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#91
post #10

Earlier quoted context omitted.

Icon fonts have been breaking websites for people that do not allow websites to set their fonts.

Are those the same people that disable JavaScript everywhere too? Imagine that you were running desktop apps and said "ok I want this program, but I only want it to use standard widgets, my chosen font, and not use certain API's. Wait why does this look funny and not work right?!"

Many dyslexics use their own fonts in their web browsers, because they like to be able to read the sites more easily.

It isn't just bloody-minded fanatics who object to web fonts.

(full disclosure: I am a bloody-minded fanatic and also object to web fonts)

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#92
post #45

Earlier quoted context omitted.

It's one of those things that works "in a perfect world", but in the real world it just doesn't work out that well. For starters, leveraging caching via a common CDN pretty much requires everyone to be using a single version from a single CDN. If you can't agree on that, then every time a new version comes out the web is split and the caching doesn't work, and every time someone decides to use another CDN (or someone…

> For starters, leveraging caching via a common CDN pretty much requires everyone to be using a single version from a single CDN. If you can't agree on that, then every time a new version comes out the web is split and the caching doesn't work, and every time someone decides to use another CDN (or someone provides a new one) the group is split again. All this common web stuff that is distributed by several CDNs (as w…

Security hole: This could leak hash preimages that the user has in cache but are sensitive.

Solution: Using a sha256="..." attribute should only allow you to access files that were initially loaded with a tag that has a sha256 attribute, and this attribute is only used for resources the developer considers public.

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#93

Earlier quoted context omitted.

Are those the same people that disable JavaScript everywhere too? Imagine that you were running desktop apps and said "ok I want this program, but I only want it to use standard widgets, my chosen font, and not use certain API's. Wait why does this look funny and not work right?!"

Actually not. I allow Javascript but I block web fonts because I think they're a stupid idea. Your argument about desktop apps isn't very good because people can (and do) prevent desktop apps from doing certain things and accessing various stuff, like web cams, the microphone, system directories, the internet, etc. If my text editor breaks because it can't access my webcam, I'd say it's a serious problem.

Just curious, how do you actually block desktop apps from doing such things, aside from unplugging the device in question that is?

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#94
You can also serve the font files with the `Cache-Control: immutable` HTTP response header so the client never needs to revalidate with the server (even when the user forces a page reload). Use versioned filenames for immutable resources if you need to change them later.

http://bitsup.blogspot.de/2016/05/cache-control-immutable.ht...

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#95
post #92
post #45

Earlier quoted context omitted.

> For starters, leveraging caching via a common CDN pretty much requires everyone to be using a single version from a single CDN. If you can't agree on that, then every time a new version comes out the web is split and the caching doesn't work, and every time someone decides to use another CDN (or someone provides a new one) the group is split again. All this common web stuff that is distributed by several CDNs (as w…

Security hole: This could leak hash preimages that the user has in cache but are sensitive. Solution: Using a sha256="..." attribute should only allow you to access files that were initially loaded with a tag that has a sha256 attribute, and this attribute is only used for resources the developer considers public.

[deleted]

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#96

Earlier quoted context omitted.

That is what I did for the shields.io logo: https://raw.githubusercontent.com/badges/shields/master/logo... Unfortunately it is still a bit big. Simply converting it to SVG would probably be smaller. I'd welcome a simple tool that does that!

I've been converting each font awesome image I need to SVG by hand. It's actually really easy. 1. Open fontawesome-webfont.svg in a text editor. 2. Find the glyph you want to use. 3. Copy it into a new file. 4. Add boilerplate[1] to new file. 5. Change the tag to a tag. 6. Add the attribute `transform="scale(0.1,-0.1) translate(0,-1536)"` 7. Open the file in Chrome and see your SVG. [1] boilerplate: {glyph goes here}…

That's more straightforward than it is easy. Easy would be:

    fa2svg f015

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#97
post #28

Is the 2000TB/day number reasonable, or just clickbait? It's all based on coming up with two numbers that when multiplied say that this resource is downloaded 73 billion times a day. That's 20 times / day for every internet user (even those using it on a 2G connection once a year). Given a reasonable caching period of 1 month, that'd mean the average user visits 600 different sites a month. That seems like much more…

Indeed.

> If each day 73 million websites serve the Font Awesome WOFF to an average of a thousand visitors who don’t have these fonts in the browser’s cache...

This assumption that they don't have the fonts cached is only sensible if each user is unique. But that means that we have 73 BILLION unique users.

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#98
post #90
post #35

Earlier quoted context omitted.

By renaming the CSS file from `font-awesome.min.css` to `fa.min.css` they could save 660GB a day: 73,000,000 sites * 1000 visitors * 10 bytes / 1024^3

A calculator for you, because I'm in pitch-my-side-project mode ;) https://instacalc.com/50060

That's pretty neat idea. The site's missing a cute calculator favicon though, which destroyed my UX.

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#99
post #90

Earlier quoted context omitted.

A calculator for you, because I'm in pitch-my-side-project mode ;) https://instacalc.com/50060

That's pretty neat idea. The site's missing a cute calculator favicon though, which destroyed my UX.

Hah, I just finished a flat redesign from mid-2000s skeuomorphic interface. Redoing the logo / favicons is that last thing...

Re: Saving the Internet 2000TB a Day: Fixing Font Awesome’s Fonts

#100

Earlier quoted context omitted.

I've been converting each font awesome image I need to SVG by hand. It's actually really easy. 1. Open fontawesome-webfont.svg in a text editor. 2. Find the glyph you want to use. 3. Copy it into a new file. 4. Add boilerplate[1] to new file. 5. Change the tag to a tag. 6. Add the attribute `transform="scale(0.1,-0.1) translate(0,-1536)"` 7. Open the file in Chrome and see your SVG. [1] boilerplate: {glyph goes here}…

That's more straightforward than it is easy. Easy would be: fa2svg f015

That's more simple than it is easy. Easy would be:

    Think "I want that glyph" and then it's just there!
Post reply on HN