Far-future expiration dates?

Upon running an analysis of a web site I see this:
There are static components without a far-future expiration date:

  • https://fonts.googleapis.com/icon?family=Material+Icons
  • https://fonts.googleapis.com/css?family=Open+Sans|Roboto:400,500
  • https://fonts.googleapis.com/css?family=Muli:300,400
  • https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css

It’s my understanding that I need to add some code to .htaccess file, something like:

ExpiresByType font/…etc.

Can you help me with the font/…etc. part? “access plus 1 year”

Also for the gitcdn.github.io part?

I’m not clear on how it should read

thanks

Surely all you need is

ExpiresByType text/css "access plus 1 month"

You can change the time period to suit, but a year seems a long time to me.

If you change the fonts, then that will be changed in the CSS files anyway.

1 Like

You should have a default for file types not specified

ExpiresDefault "access plus 1 month"
1 Like

Note the domains here, fonts.googleapis.com and gitcdn.github.io are not hosted by your server.
And since your server isn’t hosting them, there isn’t anything you can do to resolve these issues. Google and GitLab need to resolve them if they want to. Given it’s been this way for a while (I’ve seen these URLs in reports for a while now) I think they have reasons not to comply with their own advise :slight_smile:

4 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.