I tested my site via Pingdom and got this:
I searched but couldn't find a solution to this. Does anyone know how I can get this 14 to 100?
To leverage your browser's caching generally means that you can specify how long web browsers should keep images, CSS and JS stored locally. That way the user's browser will download less data while navigating through your pages, which will improve the loading speed of your website.
Google Fonts resources will be redownloaded for every website, regardless it being cached on the CDN. Self-host your fonts for better performance.
To asynchronously load Google Fonts in all browsers, you should use their JavaScript Web Font Loader. To proof the comment of soren please check caniuse.com/#feat=lazyload and you'll see he ist right.
Not a complete solution, but you can improve the situation by combining the two requests to one:
https://fonts.googleapis.com/css?family=Montserrat|Open+Sans
I do that for two fonts on one of my sites and score 86 versus your 14. Importantly, this is a genuine speedup, not just a hack to reduce an arbitrary score.
Since you cannot control Googles headers (including expiration headers), I can see only one solution – download these two stylesheets and fonts to your own hosting server, change HTML tags accordingly.
Then, you can set expiration headers (what Pingdom called 'lifetime') as you wish.
For example, open the first link:
/* latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: local('Montserrat-Regular'), url(http://fonts.gstatic.com/s/montserrat/v6/zhcz-_WihjSQC0oHJ9TCYAzyDMXhdD8sAj6OAJTFsBI.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
Download this .woff2 file and save it anywhere on your webserver. Copy & paste this piece of stylesheet into any of your own CSS files or HTML. Change the link from fonts.gstatic.com to your new URL.
Google serves these fonts with expiration time of 1 day. You could easily set it to 30 days now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With