You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add the &display=swap parameter to the end of your Google Fonts URL #429
You can now optimize the whole thing with Preconnect / dns-prefetch.
This takes the loading time of the connection establishment to the target out of the consideration. In a test case, the Google programmer Ilya Grigorik saved about 0.5 seconds of loading time by adding Preconnect when loading the Google fonts and wrote a very informative article on this topic.
Activity
prdt3e commentedon Apr 26, 2020
#403
prdt3e commentedon Apr 26, 2020
In head, if the font is cached:
And load webfontloader async with font-display: swap:
Google Lighthouse score Mobil: 100
Google Lighthouse score Desktop: 100
Der gesamte Text bleibt während der Webfont-Ladevorgänge sichtbar.
All text remains visible during webfont loads
prdt3e commentedon Apr 26, 2020
You can now optimize the whole thing with Preconnect / dns-prefetch.
This takes the loading time of the connection establishment to the target out of the consideration. In a test case, the Google programmer Ilya Grigorik saved about 0.5 seconds of loading time by adding Preconnect when loading the Google fonts and wrote a very informative article on this topic.
Does anyone have more experience or tips here?
olemarius commentedon Mar 31, 2023
May I add that in order for
display=swapto work, you need to add it only to the last font in the array.you can achieve this by doing
Adding on each item in the array passed to families will generate a request with multiple display=swap params.