-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-fonts] Clarify: use of referrers in font fetching and relationship with preloads #6775
Comments
FWIW, Chromium recently changed the referrer used for other CSS based resources, with no compat implications. |
/cc @achristensen07 - for Safari opinions |
I think this argues for not taking referrer into account for caches and that's it. @domfarolino this might interest you. |
You're right. I misremembered this change. Apologies for the noise. |
Thanks, this provides the missing context. I will amend the CSS fetch draft accordingly and will add a note about caching in my preload PR. |
I meant that Safari seems to send neither |
Is there a concrete action item for this issue at this point? It seems that:
The compat risk raised in the OP was (correct me if I'm wrong) that a font preload's referrer will be the Document's URL, while the font's actual fetch's referrer will be a style sheet URL, yet reuse the different-referrer preload response. I guess this only matters when servers send Can we just file a bug against Safari for (2) above and close this, or is there something specific that can still emerge from this? |
Currently it is not specified how fonts are fetched. This PR attempts to fix that.
However, currently there is a behavior mismatch around referrers and fonts.
When fetching web-fonts, Gecko & Chromium send the URL of the stylesheet where the font is defined rather than the URL of the document as the referrer for the font (Safari loads web-fonts without CORS).
It's unclear what this was meant for, but it has the effect of not being fully compatible with preloading (
<link rel="preload">
). Because a preload doesn't have a way to specify a referrer, and the embedding HTML does not always know which stylesheet URL will eventually load the font, this may result in incompatibilities between the preloaded request and the actual request.Also, browsers today have an out-of-spec "memory cache" or "resource cache" for fonts, where the referrer is not a cache key, so implementations are already depending on a behavior that fetching the same font with different referrers would be identical.
I suggest to not send the stylesheet URL as a referrer to avoid this problem, but I'm not sure of the implications.
The text was updated successfully, but these errors were encountered: