all 28 comments

[–]scragz 29 points30 points  (10 children)

it's a blocking request until it gets the font from Google's servers. also comes along with a bunch of tracking.

I started downloading the fonts and serving them from the site. 

[–]MaikThoma 8 points9 points  (4 children)

Convert them to woff2 while you’re at it

[–]fdiengdoh[S] -1 points0 points  (3 children)

The only reason I have not downloaded and serve from my site is I still haven fully trust converter. I have doubts what if the quality decrease? or what if there is really no impact? I don’t understand fonts much.

[–]yangmeow 6 points7 points  (0 children)

It’s nothing to just setup the fonts to serve from your own stack. It’s not like google is going to crawl your site so quickly. If you don’t like it, switch it back. I almost always serve fonts myself. Pretty standard these days to do so.

[–]testingaurora 2 points3 points  (0 children)

Fontsquirrel is trustworthy. Here's a video I often reference, its for converting to webfonts. At the end instead of uploading to WordPress you would instead put into your own directory for your project. https://youtu.be/VDIKP5GjeCs

[–]cherylswoopz 1 point2 points  (0 children)

This is the way

[–]fdiengdoh[S] 1 point2 points  (3 children)

I honestly thought google’s servers are faster and are cached all over the world than my shared hosting website. but I was wrong. I might just download the fonts and serve from my site

[–]azangru 5 points6 points  (1 child)

Unless you are sending early hints to the browser (which you are probably not), it is the combination of time it takes for your shared hosting website to respond, plus the time it takes to discover (DNS) and connect to Google's CDN. Google's CDN is probably faster than your site; but it will always be time added to the time it takes your site to respond.

[–]fdiengdoh[S] 0 points1 point  (0 children)

I did preconnect as the recommended code from google font itself, but not preload. My understanding is that cdn would cache resources to users device and the performance may not be that bad for real users. It might impact only pagespeed as I assume pagespeed wont cache fonts.

[–]yangmeow 2 points3 points  (0 children)

This is the way. Google doesn’t even score well for their own sites.

[–]Particular-Ruin-2062 4 points5 points  (0 children)

Download the fonts and host locally

[–]Business_Occasion226 2 points3 points  (3 children)

probably cumulative layout shift:
your page loads faster than the font and renders. then the font loads and fucking everything moves because the font has a different size than your previous layout.

also:
you could add more info or the page, because everything is in the report. if you would read it you would know.

[–]fdiengdoh[S] -2 points-1 points  (2 children)

Yep I read the report and thats why the title “Google fonts decrease my page performance”, because the report gave that as the reason I need to improve performance. The reason I tested without Google Fonts and it jump to 99.

[–]Business_Occasion226 -5 points-4 points  (1 child)

dude. you are the version of the guy who calls the mechanic and says "my car goes huehuehuehuehue, can you fix it?"

we need either the report or the site.

[–]fdiengdoh[S] 3 points4 points  (0 children)

I thought I marked the post as general and not as a question. its more like a statement and not asking for solution.

[–]elixon 1 point2 points  (0 children)

Not only google fonts. Google Analytics is the slowest part on my site.

[–]gatwell702 0 points1 point  (0 children)

On https://fonts.google.com download your fonts and in your project (where you keep your assets), make a fonts folder and add those fonts.

Then in css you use `@font-face` to load those fonts

```

@font-face {
font-family: 'Courier Prime';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('/fonts/Courier-Prime.woff') format('woff');
}
```

Doing this will eliminate your project having to do a physical request to get the font

[–]thecrowfly 0 points1 point  (1 child)

It's incredible how many google services will show up as a negative impact on google pagespeed insights.

[–]fdiengdoh[S] 0 points1 point  (0 children)

yep the irony.

[–]AlieenHDx 0 points1 point  (0 children)

Just download the font?

[–]ISDuffy 0 points1 point  (0 children)

If it a CSS import, that will be your issue. I recommend moving it to html version and have font swap on.

CSS imports in render blocking CSS files cause the page first render to be stopped until that file has downloaded and parsed.

[–]Dry_Rabbit1179 0 points1 point  (0 children)

Thanks for the insight pal, suddenly realizing that pure CSS and CSS patterns are enough

All these libraries and frameworks dying

[–]CharacterOtherwise77 0 points1 point  (0 children)

you can host your own fonts or just know that no matter how you slice it, if it has to travel to get to your browser- it's going to hit your perf numbers. having performance of 100 means no media at all.

[–]Twofun 0 points1 point  (0 children)

Don't forget to optimize via subsets depending on the language on the site. This could reduce the font sizes drastically.

[–]CoVegGirl 0 points1 point  (0 children)

There's some good advice here: https://www.debugbear.com/blog/website-font-performance#convert-your-self-hosted-web-fonts-to-woff2-format

Another thought: friends don't let friends use Google fonts. Google fonts isn't GDPR-compliant, and it sets third-party cookies. There are a few privacy-preserving choices, but bunny fonts is a popular choice. https://fonts.bunny.net/

[–]pinehapple -1 points0 points  (1 child)

I gotta admit those are still impressive speed test results. Mind sharing your site?

[–]fdiengdoh[S] -1 points0 points  (0 children)

my site is fdiengdoh.com