Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to set expire by type for remote fonts or Google analytics? I'm getting this report from GTMetrix and everything I've tried isn't working. Suggestions?

There are 4 static components without a far-future expiration date.

All of my other expires are working fine. But apparently this type of thing isn't right?

ExpiresByType application/x-font-woff "access 1 year"
ExpiresByType application/font-woff "access 1 year"

What should I do?

share|improve this question
up vote 1 down vote accepted

No, you can't change the expiry headers for remote files that aren't under your control.

The only way you could would be to host them on your own server - however you then remove the advantage of these files being hosted on powerful CDNs and the font files are probably already stored in other user's browser caches.

There are work-around methods to use PHP classes to cache remote content by URL that you might want to look into.

share|improve this answer
Thats pretty funny considering google's own pagespeed insights says to do the same thing. You'd think it would compensate. – Maelish Mar 7 '14 at 0:52
There's specific reasons for them not to set long cache times the analytic requests (otherwise they won't record visit data) - i'm not sure why they have short expiry set on fonts though. – Mike Hudson Mar 7 '14 at 2:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.