If you specify Expires header with future date then you may expect that specified fonts (I use woff, ttf, otf and eot) will be cached in browser local cache. Firefox 22 Web Console Net panel shows me that (for example) woff type of file is always requested from server with status code 200. What happened? I have just forgot to set header Access-Control-Allow-Origin for specified font files and there was cross-domain error for fonts.

I use Apache rules in htaccess:

<code lang="apache"><FilesMatch "\.(woff|ttf|otf|eot)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch></code>

Firefox supports the Cross-Origin Resource Sharing standard (CORS) for HTTP requests of some types of resources and simply don’t allow you to use by default a font that is not hosted on your domain, not even on your subdomain. So, you need to set Access-Control-Allow-Origin header with specified domain (or just * wildcard for all domains) to allow the domain originating the request (the Origin) access to the resource.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Comments

You can leave a response, or trackback from your own site.

Before you add comment see for rules.

Leave a Reply

Your email address will not be published. Required fields are marked *

2b4n3c