Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
121 views
in Technique[技术] by (71.8m points)

html - Google Fonts: multiple "Font" requests instead of one

I load Google Fonts this way:

<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,600,700,800|Roboto:300,300i,400,400i,500,500i,700,700i,900,900i&subset=latin-ext" rel="stylesheet">

When I analyze requests in a browser, there is one CSS request instead of two, so this is good that it loads two fonts with one request:
https://fonts.googleapis.com/css?family=Montserrat:400,600,700,800|Roboto:300,300i,400,400i,500,500i,700,700i,900,900i&subset=latin-ext

However, when I switch to "Fonts" tab, I see 7 requests like these: https://fonts.gstatic.com/s/montserrat/v15/JTUSjIg1_i6t8kCHKm459Wlhyw.woff2
https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_bZF3gnD_g.woff2
(...)
https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmEU9fBBc4.woff2
https://fonts.gstatic.com/s/roboto/v20/KFOjCnqEu92Fr1Mu51S7ACc6CsQ.woff2

In summary, there are 5 Montserrat requests and 2 for Roboto.
Could you explain me why? Maybe I don't understand something and these one are not typical requests at all. But if they are, is there a way to load it all with one request?

question from:https://stackoverflow.com/questions/66062311/google-fonts-multiple-font-requests-instead-of-one

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...