3 ms·
Fonts ought to have Subresource Integrity checksums, and clients should cache them effectively, even cross-site. It's not like they change much.
by Animats 10y ago
Fonts ought to have Subresource Integrity checksums, and clients should cache them effectively, even cross-site. It's not like they change much.
- dom0 10y agoAnd then we get cache fingerprinting attacks :) But then again we already have canvas fingerprinting... why bother with anything else until the browsers fix that?
- BinaryIdiot 10y ago> And then we get cache fingerprinting attacks :) Not really. It all depends on how the cache is implemented. Maybe get an option for installing of a font or handle it like SSL and only install fonts from known, good actors which can be invalidated should one go bad.
- sp332 10y agoCaching doesn't help that much if you're only sending the subset of the font that you're actually using for a given page. I'm not sure the same font gets loaded from different places all that often either.
- tux1968 10y agoIf the recommended alternative is for everyone to use the handful of known system fonts, we very quickly arrive at everyone loading the same fonts anyway. Increasing that pool of options by having some additional choices in a cache would be nice -- especially for those of us on less popular OS's. And having to calculate a font subset per page and transmitting it along with the content doesn't sound like a winning tactic.
- Klathmon 10y agoThis has been tried and failed many times in the past with other things. The biggest problems are with what a "canonical" version actually is, and security. Browser cache sizes are already too small to effectively cache things for one origin for any significant amount of time, and when you try to introduce cross-site caching you quickly run into a few issues. The big one for fonts is that you very rarely include a WHOLE font in your site, you generally include a subset of codes that you care about (if you are targeting english speaking users, no need to include russian characters...). But in addition to this, unless everyone everywhere agrees to load a specific version, file encoding, file format, compression format, compression settings, and more, the checksums will be so spread out as to be basically be useless. While it's less of an issue with fonts vs something like .js files, it can still be a problem. And someone else already touched on the security issue, but to go into more detail. At the very least, caching ANYTHING cross-origin lets any page you load probe for things in your cache. To use a bit of an absurdist example, A government website could try to load fonts used on a popular "terrorist" website, and if it gets a cache hit, they can immediately be pretty sure you have been on the site recently. The size of most caches, and the propensity for people to clear their cache (or use private browsing) means that this only gets more and more accurate. It's one of those things that sounds like a great idea on the surface, but in the end it would end up causing more issues than it solves. That being said, I believe there is a proposal somewhere for a standard along these lines, but I can't seem to find it any more.
- Animats 10y agoBrowser cache sizes are already too small to effectively cache things for one origin for any significant amount of time, and when you try to introduce cross-site caching you quickly run into a few issues. Oh? We have browsers eating a gigabyte of RAM now.
- Klathmon 10y agoWhich has nothing to do with cache sizes.