0

i am trying to boost my website, but when i look it on gmetrix it says following statement

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

https://fonts.googleapis.com/css?family=Raleway%3A100%2C200%2C300%2C400%2C500%2C600%2C700%2C800%2C900&ver=5.4.1 https://fonts.googleapis.com/css?family=Droid+Serif%3A400%2C700&ver=5.4.1 https://fonts.googleapis.com/css?family=Muli%3A400%2C500%2C600%2C900%7CRubik%3A500%2C700&subset=latin%2Clatin-ext

  • 2
    AFIK, you cannot add the expiration header unless you host the font yourself. However, I wouldn't worry about it. Read tunetheweb.com/blog/should-you-self-host-google-fonts – Trebor May 5 at 2:05
  • Even Google's own PageSpeed insights says that the caching values for their own hosted font files should be changed. Unfortunately, there's no way to do this and AFAIK there's no way to download the font files to host them yourself. – GeoffAtkins May 5 at 7:20
2

You cannot change the headers for requests you're not responding to. In this case, the browser will make a request to Google asking for fonts. The browser will receive a response from Google(not you) with headers(cache, encoding, etc) and body(actual resource).

Don't forget these tools point you in the right direction but are not always aware of the whole picture. When you share resources with other sites, the user may already have the requested resources cached.

| improve this answer | |

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