Should I locally store CSS generated by the Google Web Fonts API?

后端 未结 3 1149
挽巷
挽巷 2021-02-12 19:49

I am using some Google Web Fonts. I hear that Google deal with all the issues between different browsers and serve different media depending on the browser in the request header

3条回答
  •  遥遥无期
    2021-02-12 20:08

    Not an answer to your exact question, but even if it were possible at the moment, I would never locally cache any CSS that Google serves "live" because:

    • even if it works now, it may break later if they change something

    • you do not add any reliability, because the font itself still has to be fetched from Google

    • you do not really improve performance much: if everything is configured correctly, the HTTP request will happen only once and be cached thereafter. Also, the user may have the font CSS cached from another site that uses Google Fonts.

提交回复
热议问题