by dangero · 9y ago · 0 comments
Things like Source Sans Pro are not unusual.
src: url("path/my.otf") format("opentype");
can become src: url("path/my.otf") format("opentype");
src: url-hash("path/my.otf", "md5:86fb269d190d2c85f6e0468ceca42a20") format("opentype");
This way, due to the double declaration, older browsers can opt to download the file as usual while a modern browser detects the hash and can look up the file from its cache. Note I chose md5 here as an example, it may very well be possible to use any hashing scheme here.(List of problems you need to solve to introduce hash-addressable caching to Web)
With js or css libraries, there are usually multiple CDNs and every website uses a different patch version anyway.
The trade off is that there are system font thumbprinting disclosures that you potentially open yourself to tracking, if you are concerned about your privacy on the web. (I think a good idea would be for one or more of the operating systems and/or browser vendors to directly encourage installing the top so many Google Fonts, because the more people do it, the fewer privacy concerns.)