0

Google's page speed is telling me to optimize my CSS delivery for the following and I am confused.

http://*******.***/css/styles.css
https://maxcdn.bootstrapcdn.com/…t-awesome/4.5.0/css/font-awesome.min.css
https://fonts.googleapis.com/…ntserrat|Montserrat+Alternates|Open+Sans

The first one is my own css, the others are via some CDN systems. I thought using cdn for font awesome would be better than hosting it myself, and same for google fonts.

As for my own css how can I do any better than hosting it as a separate file? It is already minimized. Wouldn't it be worse to inline the whole css file for every page view?

The answers given here (Css optimization for google pagespeed insight) seems like a hack to trick the pagespeed insights.

What advice can you give me or insight to understanding what they mean would be appreciated.

Community
  • 1
  • 1
Rob
  • 2,511
  • 2
  • 20
  • 31
  • Do you need the whole set of `Open Sans` for example? And is your CSS minified? – Roy Mar 17 '16 at 18:15
  • my css is using compass, and the output style is compressed, so it's a single line with as much white space as possible removed. By all of Open+Sans do you mean I should be specifying the weights I want to use as well? – Rob Mar 17 '16 at 20:03

1 Answers1

0

Yes it'd be worse to go inline with your css as it cannot be cached. The whole point of CDN is that as many people uses them (google ones at least) it's high likely users will have them precached, hence better than hosting them at your server unrecognized by the url on the new http request.

Also I'm not sure why the SSL would matter but from your example, your server is the only one without the certificate.

librewolf
  • 434
  • 4
  • 10
  • I dont think it's the ssl that matters. My understanding is similar to what you have stated, a separate css file is preferable as it does not need to be downloaded for each page view, same for using CDN where possible. So why does google think this is a problem and that it is slowing down web sites? – Rob Mar 17 '16 at 23:32