Live data from Hacker News

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

pixelambacht.nl

61–70 of 156 posts

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

#62
post #24

Earlier quoted context omitted.

> But, isn't subsetting going to result in users now caching your subset instead of a cached copy of everything? Disk is cheap. Particularly disks that you don't pay for like your users' disks.

It's not about disk, it's about network I/O. Making your resource "more unique" means more cache misses and more requests that need to be served (in theory anyway, see Klathmon's sibling comment[0] for more on this). [0]: https://news.ycombinator.com/item?id=13138826

Not being a fan of used shared CDNs for static resources[1], I don't see the issue here. They're going to have to download something anyway so from the perspective of your users it's still one download, just smaller. With proper unique namespacing (unique URL per version) and HTTP Cache-Control headers, they only have to download it once (assuming they don't clear their local cache).

[1]: Combination of security reasons and unnecessarily coupling apps to the public internet.

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

#63

Stuff like this is like rearranging chairs on the titanic - 26 kilobytes is a drop in the bucket compared to the bloat created by all the other shit people slap on to their sites - ad scripts for example

Maybe, but at some point you need to clear those chairs out of the way if you want to get anyone to the boats.

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

#64

If you're only using a small subset of FontAwesome (as I suspect many people do), I'd imagine at some point it'd make a lot of sense to use data-uri's to effectively embed them directly in an existing request, which would be faster than a CDN? I saw a talk by someone from Smashing Magazine where they basically did this for a subset of their WebFonts (downloading the entire font asynchronously afterward), then they ca…

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!

Here, reduced it from 8832 bytes down to 4710

http://olegkikin.com/badge2_cleaned.svg

And it GZips better as well (4793 -> 2120).

I opened it in Inkscape, converted the text to path. Then ran it through SVGCleaner.

You can also do manual simplification in Inkscape (Ctrl + L) till the quality starts to degrade. This lets you reduce things even further:

http://olegkikin.com/badge3_cleaned.svg

3516 bytes, 1726 GZipped.

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

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

The mechanism here (if not the intent) is pretty similar to subresource integrity[1]. [1]: https://developer.mozilla.org/en-US/docs/Web/Security/Subres...

Was about to reply with exactly that information, but as it turns out apparently doing content addressable caching via the SRI mechanism has some problems and maybe is not possible:

https://hillbrad.github.io/sri-addressable-caching/sri-addre...

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

#66

Stuff like this is like rearranging chairs on the titanic - 26 kilobytes is a drop in the bucket compared to the bloat created by all the other shit people slap on to their sites - ad scripts for example

so your argument why bother reducing bandwidth usage at all?

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

#67

Earlier quoted context omitted.

I don't know where they came up with the 73 million sites umber, but let's assume there are that many sites using font awesome. Most sites are obscure, and rarely get any visitors at all. Maybe 10 a month, or none. Popular sites that receive a lot of traffic are also visited very frequently by the same user, so the font will be in the cache. In addition, plenty of sites use a CDN for fontawesome. I guess that number…

73 million sites comes from our friends at Meanpath (their search engine isn't running anymore, sadly). They showed us on 7.3% of websites. Best guess is there are about a billion sites on the internet. Thus, 73 million.

Where did the 1000/visitors/site/day come from? This is what seems unlikely and improbable. This resource is being cached as well, so these numbers do seem obtuse.

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

#68
post #66

Stuff like this is like rearranging chairs on the titanic - 26 kilobytes is a drop in the bucket compared to the bloat created by all the other shit people slap on to their sites - ad scripts for example

so your argument why bother reducing bandwidth usage at all?

no, just your HN-standard pessimistic observation on its efficacy =]

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

#69

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!

Here, reduced it from 8832 bytes down to 4710 http://olegkikin.com/badge2_cleaned.svg And it GZips better as well (4793 -> 2120). I opened it in Inkscape, converted the text to path. Then ran it through SVGCleaner. You can also do manual simplification in Inkscape (Ctrl + L) till the quality starts to degrade. This lets you reduce things even further: http://olegkikin.com/badge3_cleaned.svg 3516 bytes, 1726 GZipped.

Nice! Can I use it?

(If you want, you can also submit a patch in https://github.com/badges/shields.)

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

#70

Earlier quoted context omitted.

Here, reduced it from 8832 bytes down to 4710 http://olegkikin.com/badge2_cleaned.svg And it GZips better as well (4793 -> 2120). I opened it in Inkscape, converted the text to path. Then ran it through SVGCleaner. You can also do manual simplification in Inkscape (Ctrl + L) till the quality starts to degrade. This lets you reduce things even further: http://olegkikin.com/badge3_cleaned.svg 3516 bytes, 1726 GZipped.

Nice! Can I use it? (If you want, you can also submit a patch in https://github.com/badges/shields. )

Yeah, it's your artwork, I just optimized it.
Post reply on HN