3 ms·
I would love if they released the server logic that chose which file to include. With http/2 I'd like to host the files so that they are served from the same o
by buro9 10y ago
I would love if they released the server logic that chose which file to include.
With http/2 I'd like to host the files so that they are served from the same origin, I'd also like to cache the CSS longer than a day.
At the moment I hit two domains (and I preconnect) to try and speed this up:
<link rel="preconnect" href="https://fonts.googleapis">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Then in my CSS I import:
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Merriweather:400,400italic,700italic,700);
That URL loads:
1. More fonts than I need.
2. Different font files depending on... useragent?
I'd prefer to self-host so that I could user http/2 server push for new sessions, and so that I could extend the caching.
The same origin via http/2 would accelerate all of the connections, and removing the need for the additional TLS connection to 2 Google properties will speed it up too.
These are about my only criticisms of Google fonts, that the little bit to make it really useful for those who want webfonts and performance is the bit that's hidden.