Nils Kaspersson
Nils Kaspersson

Reputation: 9464

Do custom @font-face cache between domains?

If I declare a @font-face on one domain and then on another domain with the same font-family-name and files/file names, will they be cached?

For instance, if i visit domain-a.com which has this CSS (and asks the client to cache the resources):

@font-face {
  font-family: 'font-name';
  src:url('f/font-name.eot');
  src:url('f/font-name.eot?#iefix') format('embedded-opentype'),
    url('f/font-name.woff') format('woff'),
    url('f/font-name.ttf') format('truetype'),
    url('f/font-name.svg#font-name') format('svg');
  font-weight: normal;
  font-style: normal;
}

And then visit domain-b.com which has the same CSS, will the browser use the cached resources or will it request them again?

My reason for asking is in regard to icon fonts. I want to streamline my workflow by using a default build of icon fonts which I, for some sites, will add additional icons to. If they do cache this wouldn't really be a good idea.

Upvotes: 1

Views: 467

Answers (1)

JC Hulce
JC Hulce

Reputation: 1571

No, this won't be cached. Caching in browsers is always segmented by domain. Resources, such as a font, that are in the cache from domain-a.xyz won't appear in domain-b.xyz's cache and vise versa.

Upvotes: 2

Related Questions