Home > Mobile >  Why Google Font preconnects to fonts.googleapis.com
Why Google Font preconnects to fonts.googleapis.com

Time:09-27

I want to add Quicksand Font to my website so google prompted me to add the following -

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=**Quicksand:wght@500**&display=swap" rel="stylesheet">

My question is - what is the advantage we are going to get with first line of code i.e. preconnecting to fonts.googleapis.com

I mean I get the point of preconnecting to fonts.gstatic.com as the fonts files are residing in that domain

CodePudding user response:

Modern browsers try their best to anticipate what connections a page will need, but they cannot reliably predict them all. The good news is that you can give them a (resource

  • Related