3 ms·
This 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. Br
by Klathmon 10y ago
This 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.